
PT-20 Programming Guide
Get file length information of a DAT file.
datasize = filelength(fd);
The filelength function returns the size in number of bytes of the
DAT file whose file handle is specified in the argument fd.
The long integer value returned by filelength is the size of the
DAT file in number of bytes. In case of error, filelength returns a
long value of -1 and an error code is set to the global variable
fErrorCode to indicate the error condition encountered. Possible
error codes and their interpretation.
2:File specified by fd does not exist.
8:File not opened
Get file directory information.
int filelist(char * file_list);
total_file = filelist(file_list);
The filelist function copies the file name, file type, and file size
information (separated by a blank character) of all files in
existence into a character array specified in the argument dir.
When char * file_list = NULL,it will pass the length that the file
string needs back.
For example, if there are two files in “C:\Data”, the filename are
StoreIn.dat and StoreOut, and their filesize are 100bytes and 150bytes,
the data in the return buffer is “C:\Data\StoreIn.dat dat 100
C:\Data\StoreOut.dat dat 150”
When “char*file_list” is NULL, it will pass the size of memory
back.
When “char*file_list” is not NULL, it will pass the quantity of file
back.
Move file pointer of a DAT file to a new position.
long lseek(int fd, long offset, int origin);
Kommentare zu diesen Handbüchern