GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FES / V6-5-0 > fes_ux / rhel4-32
#include <fesParm.h>
Classes | |
struct | fesFileStat_s |
File status. More... | |
struct | fesFileStatFs_s |
File system status. More... | |
struct | fesDiskInfo_s |
Disk information. More... | |
struct | fesDirInfo_s |
Directory information. More... | |
struct | fesFileInfo_s |
File information. More... | |
Typedefs | |
typedef struct fesFileStat_s | fesFileStat_t |
File status. | |
typedef struct fesFileStatFs_s | fesFileStatFs_t |
File system status. | |
typedef struct fesDiskInfo_s | fesDiskInfo_t |
Disk information. | |
typedef struct fesDirInfo_s | fesDirInfo_t |
Directory information. | |
typedef struct fesFileInfo_s | fesFileInfo_t |
File information. | |
Enumerations | |
enum | { FFO_RDONLY = 0, FFO_WRONLY = 1, FFO_RDWR = 2, FFO_CREAT = 0x10, FFO_APPEND = 0x20, FFO_TRUNC = 0x40 } |
Open flags. More... | |
enum | { FFS_START = 0, FFS_CURR = 1, FFS_END = 2 } |
Seek bases. More... | |
enum | { FST_NONE = 0, FST_NAME = 1, FST_DATE = 2, FST_SIZE = 3 } |
Sort types. More... | |
enum | { FDT_NODIR = 1, FDT_NOINFO = 2 } |
Display types. More... | |
enum | { FPO_IGNCASE = 0x01, FPO_SRCHTRE = 0x02, FPO_DELTREE = 0x04 } |
Processing options. More... | |
enum | { FDO_BYTES = 0x01, FDO_SHORTS = 0x02, FDO_WIDE = 0x04, FDO_TEXT = 0x08, FDO_LITEND = 0x10 } |
File dump options. More... | |
enum | { ITP_END = 0, ITP_DIR = 1, ITP_FILE = 2 } |
Information types. More... | |
enum | { IST_OKAY = 0, IST_TRUNC = 1, IST_NOSTAT = 2, IST_NODIR = 3 } |
Information status values. More... | |
Functions | |
int | fesFileDiskFormat (int unit, int noConf) |
Format a disk drive. | |
int | fesFileInit (void) |
Initialize the file information. | |
int | fesFileClose (void *hndl) |
Close a file. | |
int | fesFileCopy (const char *sName, const char *dName, int copyTree) |
Copy files matching a pattern. | |
int | fesFileDel (const char *name, int option, int fOptns, int *nDelete) |
Delete files matching a pattern. | |
int | fesFileDirCre (const char *name, int creInt, int *errorP) |
Create directories. | |
int | fesFileDirNameComp (const char *dName1, const char *dName2) |
Compare two directory names. | |
int | fesFileDiskInfoGet (const char *name, char *nName, int *nDisk, fesDiskInfo_t **dInfo) |
Get disk information. | |
const char * | fesFileDiskName (int unit, int system) |
Get disk name. | |
int | fesFileDiskShow (const char *name) |
Show disk information. | |
int | fesFileDump (const char *name, long long first, int count, int pSize, int optns) |
Dump the contents of a file. | |
int | fesFileFlush (void *hndl) |
Flush write data to a file. | |
int | fesFileInfoAdd (const char *data, char **info, int *iLeng, int *cLeng) |
Add new item of file information. | |
int | fesFileInfoGet (const char *name, int optns, char *nName, int *size, char **fInfo) |
Get file information. | |
int | fesFileInfoNext (const char *info, fesDirInfo_t **dInfo, fesFileInfo_t **fInfo, int *newDir) |
Get next item of file information. | |
fesFileInfo_t ** | fesFileInfoSort (const fesDirInfo_t *dInfo, const fesFileInfo_t *fInfo, int sortType) |
Sort file information. | |
int | fesFileNameComp (const char *fName1, const char *fName2) |
Compare two file names. | |
int | fesFileOpen (void **hndl, const char *name, int optns) |
Open a file. | |
int | fesFileRead (void *hndl, char *buff, int leng, int *nRead) |
Read from a file. | |
int | fesFileRename (const char *name, const char *nName) |
Rename a file. | |
int | fesFileSeek (void *hndl, int base, long long offset, long long *posn) |
Position a file. | |
int | fesFileShow (const char *name, int optns, int dispType, int sortType) |
Show file information. | |
int | fesFileStat (void *hndl, fesFileStat_t *fStat) |
Get file status information. | |
int | fesFileStatShow (const char *name) |
Show file status information. | |
int | fesFileTimeRead (const char *name, int bufSize, int check) |
Time reading a file. | |
int | fesFileTimeWrite (const char *name, long long flSize, int bufSize) |
Time writing a file. | |
int | fesFileUtime (const char *name, unsigned int *aTime, unsigned int *mTime) |
Update file times. | |
int | fesFileWrite (void *hndl, const char *buff, int leng, int *nWrte) |
Write to a file. |
$Id: fesFile.h,v 1.12 2011/03/29 23:04:20 saxton Exp $
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
int fesFileClose | ( | void * | hndl | ) |
Close a file.
This routine closes a file.
hndl | The handle of the file, returned when the file was opened. |
FES_SUCCESS | The file was successfully closed. | |
FES_xxx | An error occurred. |
Referenced by fesDataDisp(), fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesFileDump(), fesFileTimeRead(), fesFileTimeWrite(), fesTextClose(), and fesTextOpenR().
int fesFileCopy | ( | const char * | sName, | |
const char * | dName, | |||
int | copyTree | |||
) |
Copy files matching a pattern.
All the files matching the specified pattern are copied to the specified destination.
sName | The source file name pattern, which may have an optional node name prepended to it and separated by a colon. The file name proper may contain the usual wildcard characters ("?" and "*"), but the device and directory names may not. If the file name proper is empty, all files in the directory are copied. | |
dName | The destination file or directory name, which may have an optional node name prepended to it and separated by a colon. If the source name specifies more than one file, this must be a directory name. | |
copyTree | Specifies whether matching directories and all files in the tree below each are copied. If FALSE (zero), only matching files are copied. |
FES_SUCCESS | Success. | |
FES_LONGNODE | Node name too long. | |
FES_CANTCONN | Can't connect to remote node. | |
FES_LONGFNAM | Directory name too long. | |
FES_DDIRMSSG | Destination directory not found. | |
FES_COPYTREE | Attempt to copy tree to a file. | |
FES_EDIROPEN | Can't open source directory. | |
FES_EDIRREAD | Error reading source directory. | |
FES_NOFILINF | Can't get file information. | |
FES_EDIRCRE | Can't create destination directory. | |
FES_COPYMULT | Attempt to copy multiple files to one. | |
FES_COPYSELF | Attempt to overwrite an input file. | |
FES_EFILOPEN | Can't open input file. | |
FES_EFILECRE | Can't create output file. | |
FES_NOMEMORY | Insufficient memory for data buffer. | |
FES_EFILERD | Error reading input file. | |
FES_EFILEWRT | Error writing output file. |
int fesFileDel | ( | const char * | name, | |
int | option, | |||
int | fOptns, | |||
int * | nDelete | |||
) |
Delete files matching a pattern.
All the files matching the specified pattern are deleted.
name | The file name pattern. Refer to the description of fesFileInfoGet for more information. | |
option | An option specifying the way the deletion is carried out. The possible values are: 0: Confirm each file to be deleted. > 0: Display a message after each file deleted. < 0: Silently delete all matching files. When confirmation is requested, several possible responses are available: y: Delete this file a: Delete this and all other matching files without further confirmation. A message is displayed for each file deleted. q: Don't delete any more files. d: Don't delete any more files from the current directory. n: (or anything else) Don't delete this file. | |
fOptns | File processing options expressed as the OR of the following possible values:
| |
nDelete | The address of an integer to receive the number of files deleted, or NULL if this number is not needed. |
FES_SUCCESS | Success. | |
FES_NOFILNAM | No file name specified. | |
FES_LONGNODE | Node name too long. | |
FES_ECONNECT | Can't connect to remote node. |
Referenced by fesDataDel().
int fesFileDirCre | ( | const char * | name, | |
int | creInt, | |||
int * | errorP | |||
) |
Create directories.
The specified directory is created in the system. There may be several instances of it depending on how the disk is specified in the name.
name | The directory name specifier. If it starts with a slash, the beginning part (i.e. up to the next slash) is taken to be a disk name, and can contain wild-card characters. Otherwise all data disks (i.e. those with names ending in "b") are used. The remainder of the name is the full path name of the directory to be created. | |
creInt | A flag which, if TRUE, causes all intermediate directories to be created, if necessary. Otherwise the parent directory of the directory to be created must already exist. | |
errorP | The address of an integer to receive a mask of bits indicating which of the disks had an error. If NULL, no error mask is returned. |
FES_SUCCESS | Success. | |
FES_LONGNODE | Node name too long. | |
FES_CANTCONN | Cannot connect to remote node. | |
FES_LONGDISK | Disk name too long. | |
FES_NODSKFND | No matching disks found. | |
FES_EDIRCRE | Error creating directory. |
int fesFileDirNameComp | ( | const char * | dName1, | |
const char * | dName2 | |||
) |
Compare two directory names.
This routine compares two directory names and returns a value indicating the outcome. The comparison is first done using a case-insensitive compare tailored for directory names ("/" comes before any other character), then an exact compare if the first shows equality.
dName1 | The address of the first directory name. | |
dName2 | The address of the second directory name. |
0 | The names are the same. | |
1 | The first name comes lexically after the second. | |
-1 | The first name comes lexically before the second. |
int fesFileDiskFormat | ( | int | unit, | |
int | noConf | |||
) |
Format a disk drive.
This routine formats the specified disk drive by creating two partitions on it, one small and one large.
unit | The unit number of the disk drive. | |
noConf | If TRUE, the operation is not confirmed interactively before proceeding. |
FES_SUCCESS | Formatting was successful. | |
FES_INVUNIT | Invalid unit number. | |
FES_OPABORT | Operation aborted by operator. | |
FES_EATACRE | Error creating ATA device. | |
FES_EPARTCRE | Error creating disk partitions. | |
FES_EDISKCRE | Error creating disk devices. | |
FES_EDISKFMT | Error formatting disk. |
int fesFileDiskInfoGet | ( | const char * | name, | |
char * | nName, | |||
int * | nDisk, | |||
fesDiskInfo_t ** | dInfo | |||
) |
Get disk information.
This routine gets information about the specified disks and returns it in allocated memory. On a Unix system, information is obtained about specified mounted file systems.
name | The disk name specifier, which can start with an optional node name terminated with a colon, and which can also contain wild-card characters. If the disk name proper is empty, it defaults to all non-system disks on FES nodes, and to all mounted file systems on Unix systems. | |
nName | The address of an area, at least FES_NNAME_MAX bytes long, to receive the node name specified in the disk name; or NULL to ignore the node name. | |
nDisk | The address of an integer to receive the number of disks matching the specifier. | |
dInfo | The address of a pointer to receive the address of the generated array of disk information. The memory used by this array must be freed after being used. |
FES_SUCCESS | Success. | |
FES_NODSKFND | No matching disks. | |
FES_CANTCONN | Can't connect to remote node. | |
FES_NOMEMORY | No memory available for disk info. | |
FES_EDISKINF | Error obtaining disk information. |
References fesDiskInfo_s::aBlks, fesFileStatFs_s::bavail, fesFileStatFs_s::bfree, fesDiskInfo_s::blkSize, fesFileStatFs_s::blocks, fesFileStatFs_s::bsize, fesDiskInfo_s::fBlks, fesErrnoTran(), fesDiskInfo_s::name, and fesDiskInfo_s::nBlks.
Referenced by fesFileDiskShow().
const char* fesFileDiskName | ( | int | unit, | |
int | system | |||
) |
Get disk name.
This routine gets the name of the disk associated with a given disk number and type.
unit | The disk number. | |
system | FALSE for a data disk partition; TRUE for a system partition. |
Referenced by fesDataDel(), fesDataDisp(), fesDataInfoGet(), fesDataJoin(), fesDataLoad(), and fesDataRename().
int fesFileDiskShow | ( | const char * | name | ) |
Show disk information.
Information about the specified disks is displayed.
name | The disk name specifier, which can contain wild-card characters. It may also start with a node name, separated from the rest of the name by a colon, in which case the disks on the remote node are used. |
References fesDiskInfo_s::aBlks, fesDiskInfo_s::blkSize, fesDiskInfo_s::fBlks, fesFileDiskInfoGet(), fesDiskInfo_s::name, and fesDiskInfo_s::nBlks.
int fesFileDump | ( | const char * | name, | |
long long | first, | |||
int | count, | |||
int | pSize, | |||
int | optns | |||
) |
Dump the contents of a file.
This routine produces a formatted hexadecimal dump of the specified portion of a file.
name | The address of the name of the file to be dumped. The name may start with a node name followed by a colon in order to specify a file on a remote node. | |
first | The offset within the file of the first byte to be dumped. | |
count | The maximum number of bytes to be dumped. If non- positive, the only limit is the end of the file. | |
pSize | The page size to use. This is the number of lines to display at a time before pausing to prompt for the next page. If zero, the default value of 24 is used. If negative, the output is not paused. | |
optns | A word containing option bits controlling the format of the dump. Recognized bits are the following: |
References FDO_BYTES, FDO_LITEND, FDO_SHORTS, FDO_TEXT, FDO_WIDE, fesFileClose(), fesFileOpen(), fesFileRead(), fesFileSeek(), FFO_RDONLY, and FFS_START.
int fesFileFlush | ( | void * | hndl | ) |
Flush write data to a file.
This routine flushes any buffered write data to a file.
hndl | The handle of the file, returned when the file was opened. |
FES_SUCCESS | The file was successfully flushed. | |
FES_xxx | An error occurred. |
Referenced by fesTextFlush().
int fesFileInfoAdd | ( | const char * | data, | |
char ** | info, | |||
int * | iLeng, | |||
int * | cLeng | |||
) |
Add new item of file information.
This routine adds a new item of file information to the end of a file information block.
data | The address of the data to be added. It must point to a valid information item: directory, file or end. | |
info | The address of a pointer containing the address of the file information block. If the pointer is NULL, a new block is allocated with the length specified by iLeng, or a default if this is zero. The pointer may also be updated if the block is too short to hold the new data and has to be re-allocated. | |
iLeng | The address of an integer to specify the initial or current length of the file information block, or to receive the new length if the block is re-allocated. | |
cLeng | The address of an integer to receive the current used length in the file information block. This should not be changed between calls. |
FES_SUCCESS | The new data was added successfully. | |
FES_NOMEMORY | The block was too short, and re-allocation failed (reported). |
References ITP_DIR, ITP_FILE, fesFileInfo_s::name, fesDirInfo_s::name, and fesDirInfo_s::type.
Referenced by fesDataInfoGet().
int fesFileInfoGet | ( | const char * | name, | |
int | optns, | |||
char * | nName, | |||
int * | fISize, | |||
char ** | fInfo | |||
) |
Get file information.
This routine gets information about all the files matching the given pattern and puts it into a formatted information block.
name | The file name pattern. This can contain up to five parts - the node name, the disk name, the directory name, the file name stem, and the file type, each of which, except for the node name, can contain the standard wild-card characters "?" (match any one character) and "*" (match zero or more characters). The node name, if present, is separated from the rest of the file name by a colon. If absent, the local node is used. The presence of a disk name is indicated by a leading "/", and if absent, defaults to all data disks (name ends in "b"). It is separated from any following components by a "/". The directory name is everything up to the last "/" in the name (following any disk name). The file name proper is the remainder of the name, with the stem being everything up to the last ".", and the type being the remainder. The stem and type both default to "*" if absent. | |
optns | Processing options, expressed as the OR of the following possible values:
| |
nName | The address of an area, at least FES_NNAME_MAX bytes long, to receive the node name specified in the file name; or NULL to ignore the node name. | |
fISize | The address of an integer to receive the size of the generated file information block. | |
fInfo | The address of a pointer to receive the address of the file information block. This block must be freed after use via the free() function. |
FES_SUCCESS | Success. | |
FES_NAMELONG | Overall name too long. | |
FES_LONGDISK | Disk name too long. | |
FES_LONGFNAM | File name stem too long. | |
FES_LONGFTYP | File type too long. | |
FES_CANTCONN | Can't connect to remote node. | |
FES_NODSKFND | No matching disks found. | |
FES_NOMEMORY | Insufficient memory for directory or file info. |
Referenced by fesDataInfoGet(), and fesFileShow().
int fesFileInfoNext | ( | const char * | info, | |
fesDirInfo_t ** | dInfo, | |||
fesFileInfo_t ** | fInfo, | |||
int * | newDir | |||
) |
Get next item of file information.
This routine gets the next item of file information from a file information block previously generated by a call to fesFileInfoGet.
info | The address of the file information block. | |
dInfo | The address of a pointer to receive the address of the directory information for the next file. The pointer must be set to NULL before the first call to this routine. It is returned as NULL when the end of the information has been reached. The pointer value must not be changed between successive calls. | |
fInfo | The address of a pointer to receive the address of the file information for the next file. The pointer will be NULL if an empty directory is returned. The pointer value must not be changed between successive calls. | |
newDir | The address of an integer which will be set to TRUE if the item is in a new directory, or FALSE if it isn't. |
FES_SUCCESS | Always. |
References ITP_END, ITP_FILE, fesFileInfo_s::name, fesDirInfo_s::name, fesDirInfo_s::type, and fesFileInfo_s::type.
Referenced by fesDataDel(), fesDataInfoGet(), fesDataShow(), fesFileInfoSort(), and fesFileShow().
fesFileInfo_t** fesFileInfoSort | ( | const fesDirInfo_t * | dInfo, | |
const fesFileInfo_t * | fInfo, | |||
int | sortType | |||
) |
Sort file information.
This routine sorts the supplied file information into the requested order. It doesn't change the input data, but returns an array of sorted file information pointers.
dInfo | The address of the directory information for the file information to be sorted. | |
fInfo | The address of the file information to be sorted. | |
sortType | The type of sort to be performed on the data. Possible values are: |
References fesFileInfoNext(), fesFileNameComp(), FST_DATE, FST_NAME, FST_NONE, FST_SIZE, fesFileInfo_s::mTime, fesFileInfo_s::name, fesDirInfo_s::nFile, and fesFileInfo_s::size.
Referenced by fesDataDel(), fesDataInfoGet(), and fesFileShow().
int fesFileInit | ( | void | ) |
Initialize the file information.
This routine initializes the file information by defining names for all the hard disk partitions present.
FES_SUCCESS | Initialization was successful. | |
FES_EDISKCRE | Error creating disk devices. |
int fesFileNameComp | ( | const char * | fName1, | |
const char * | fName2 | |||
) |
Compare two file names.
This routine compares two file names and returns a value indicating the outcome. The comparison is first done using a case-insensitive compare, then an exact compare if the first shows equality.
fName1 | The address of the first file name. | |
fName2 | The address of the second file name. |
0 | The names are the same. | |
1 | The first name comes lexically after the second. | |
-1 | The first name comes lexically before the second. |
Referenced by fesDataInfoGet(), and fesFileInfoSort().
int fesFileOpen | ( | void ** | hndl, | |
const char * | name, | |||
int | flags | |||
) |
Open a file.
This routine opens the specified file.
hndl | The address of a pointer to receive the handle for the open file. | |
name | The address of the name of the file to be opened. This may start with a node name separated from the rest of the name by a colon. In this case, the file is opened on the remote node. | |
flags | The flag value specifying how to open the file. This can have one of the values FFO_RDONLY, FFO_WRONLY, or FFO_RDWR, optionally ORed with any of FFO_CREAT, FFO_APPEND and FFO_TRUNC. |
FES_SUCCESS | The file was successfully opened. | |
FES_xxx | An error occurred. |
Referenced by fesDataDisp(), fesFileDump(), fesFileTimeRead(), fesFileTimeWrite(), fesTextOpenR(), and fesTextOpenW().
int fesFileRead | ( | void * | hndl, | |
char * | data, | |||
int | lData, | |||
int * | nRead | |||
) |
Read from a file.
This routine reads data from a file.
hndl | The handle of the file, returned when the file was opened. | |
data | The address where the read data is to be stored. | |
lData | The maximum number of bytes to read. | |
nRead | The address of an integer to receive the number of bytes read. |
FES_SUCCESS | The read was successful. | |
FES_EOFREAD | End of file was reached. | |
FES_xxx | A read error occurred. |
References fesErrnoTran(), and fesNmsgErrTran().
Referenced by fesFileDump(), and fesFileTimeRead().
int fesFileRename | ( | const char * | name, | |
const char * | nName | |||
) |
Rename a file.
This routine changes the name of a file.
name | The address of the name of the file to be renamed. The name may start with a node name followed by a colon in order to specify a file on a remote node. | |
nName | The address of the new name of the file. If it starts with a node name, it must be the same as the node in the old file name. If it consists only of a directory name (i.e. it ends with "/"), the file is renamed into this directory. If the new name contains no directory name, the file is renamed in its original directory. |
FES_SUCCESS | The file was renamed successfully. | |
FES_NOFILNAM | A file name is missing. | |
FES_DIFNODES | The new name specifies a different node. | |
FES_CANTCONN | Unable to connect to remote node. | |
FES_EFILEREN | An error occurred doing the rename. |
Referenced by fesDataRename().
int fesFileSeek | ( | void * | hndl, | |
int | base, | |||
long long | offset, | |||
long long * | posn | |||
) |
Position a file.
This routine seeks to a new position in a file.
hndl | The handle of the file, returned when the file was opened. | |
base | The base for the new offset: FFS_START, FFS_CURR, or FFS_END. | |
offset | The offset of the requested position from the base. | |
posn | The address of a long long integer to receive the resulting absolute position in the file, or NULL if the position is not wanted. |
FES_SUCCESS | The seek was successful. | |
FES_xxx | An error occurred. |
References fesNmsgErrTran(), FFS_CURR, and FFS_START.
Referenced by fesFileDump().
int fesFileShow | ( | const char * | name, | |
int | optns, | |||
int | dispType, | |||
int | sortType | |||
) |
Show file information.
The names of all the files on a node matching the specified pattern are displayed, along with their sizes and modification times.
name | The file name pattern. Refer to the description of fesFileInfoGet for more information. | |
optns | Processing options, expressed as the OR of the following possible values:
| |
dispType | The way the data is to be displayed. It consists of the logical OR of the possible bit values:
| |
sortType | The type of sort to be performed on the file names within each directory (directories are always sorted by full path name). Possible values are: |
References FDT_NODIR, FDT_NOINFO, fesFileInfoGet(), fesFileInfoNext(), fesFileInfoSort(), fesTimeStr(), IST_OKAY, IST_TRUNC, fesFileInfo_s::mode, fesFileInfo_s::mTime, fesFileInfo_s::name, fesDirInfo_s::name, fesFileInfo_s::size, fesFileInfo_s::stat, and fesDirInfo_s::stat.
int fesFileStat | ( | void * | hndl, | |
fesFileStat_t * | fStat | |||
) |
Get file status information.
This routine gets status information about an open file.
hndl | The handle of the file, returned when the file was opened. | |
fStat | The address of the area to receive the file status data. |
FES_SUCCESS | The status was successfully obtained. | |
FES_xxx | An error occurred. |
References fesFileStat_s::atime, fesFileStat_s::blksize, fesFileStat_s::blocks, fesFileStat_s::ctime, fesFileStat_s::dev, fesNmsgErrTran(), fesFileStat_s::gid, fesFileStat_s::inode, fesFileStat_s::mode, fesFileStat_s::mtime, fesFileStat_s::nlink, fesFileStat_s::rdev, fesFileStat_s::size, and fesFileStat_s::uid.
int fesFileStatShow | ( | const char * | name | ) |
Show file status information.
This routine displays detailed information about a file.
name | The address of the name of the file. The name may start with a node name followed by a colon in order to specify a file on a remote node. |
References fesFileStat_s::atime, fesFileStat_s::blksize, fesFileStat_s::blocks, fesFileStat_s::ctime, fesFileStat_s::dev, fesTimeStr(), fesFileStat_s::gid, fesFileStat_s::inode, fesFileStat_s::mode, fesFileStat_s::mtime, fesFileStat_s::nlink, fesFileStat_s::rdev, fesFileStat_s::size, and fesFileStat_s::uid.
int fesFileTimeRead | ( | const char * | name, | |
int | bufSize, | |||
int | check | |||
) |
Time reading a file.
This routine reads the specified file and measures how long it takes. Any errors are reported.
name | The name of the file to be read. | |
bufSize | The size of the buffer to read the file into. | |
check | If TRUE, the read data is compared with the standard used in write testing. Otherwise no check is done. |
FES_SUCCESS | The file was read successfully. | |
FES_NOMEMORY | Insufficient memory for buffer. | |
FES_xxx | An error occurred. |
References fesFileClose(), fesFileOpen(), fesFileRead(), and FFO_RDONLY.
int fesFileTimeWrite | ( | const char * | name, | |
long long | flSize, | |||
int | bufSize | |||
) |
Time writing a file.
This routine writes the specified file and measures how long it takes. Any error is reported.
name | The name of the file to be written. | |
flSize | The size of the file to be written. | |
bufSize | The size of the buffer to write the file from. |
FES_SUCCESS | The file was written successfully. | |
FES_NOMEMORY | Insufficient memory for buffer. | |
FES_xxx | An error occurred. |
References fesFileClose(), fesFileOpen(), fesFileWrite(), FFO_CREAT, FFO_TRUNC, and FFO_WRONLY.
int fesFileUtime | ( | const char * | name, | |
unsigned int * | aTime, | |||
unsigned int * | mTime | |||
) |
Update file times.
This routine updates the access and modification times of a file.
name | The name of the file to be operated on. | |
aTime | The address of the new access time to be set on the file, or NULL to leave it unchanged. | |
mTime | The address of the new modification time to be set on the file, or NULL to leave it unchanged. |
FES_SUCCESS | The file was updated successfully. | |
FES_xxx | An error occurred. |
int fesFileWrite | ( | void * | hndl, | |
const char * | data, | |||
int | lData, | |||
int * | nWrte | |||
) |
Write to a file.
This routine writes data to a file.
hndl | The handle of the file, returned when the file was opened. | |
data | The address of the data to be written. | |
lData | The number of bytes to write. | |
nWrte | The address of an integer to receive the number of bytes written, or NULL if this isn't wanted. |
FES_SUCCESS | The write completed successfully. | |
FES_xxx | An error occurred. |
References fesErrnoTran().
Referenced by fesDataGen(), fesDataGenPedes(), fesDataGenTrig(), fesFileTimeWrite(), and fesTextWrite().