IB Statements/fstat
From CometWiki
FSTAT function
Syntax: FSTAT(filename[,DIR=directory][,EXCP=statement-label])
Discussion: The FSTAT function returns file status information.
The filename may be a string constant, a single-element string variable, a string array element, a string expression, or a string function.
If you specify a directory, and the file does not exist, FSTAT succeeds and gives you the next file in the directory you specified. If you do not specify a directory, and the file does not exist, Comet gives you an error 11 (file not found).
Return values: Position Length Description/Values
===================================================================
1 1 File type
K = keyed file
D = sequential file
T = text file
O = Comet object program
Q = QICBASIC object program
2 1 Locked status
"P" = locked
"" or "@00@" = unlocked
3 3 Directory name
6 3 Open count (decimal)
9 3 Extract count (decimal)
12 3 Record size (# of bytes, decimal)
15 4 Size of data file (# of bytes, hex)
19 6 Create date (MMDDYY)
25 6 Update date (MMDDYY)
31 3 Key length
(# of bytes, decimal, key files only)
34 1 Unused
35 11 Next file name in directory
46 4 Record size (# of bytes, decimal, 4 digits)
50 12 Whole file name after the conversion from Qantel
characters to DOS characters, in the form:
filename (8 characters with blanks appended),
period (if extension is supplied), and
extension (3 characters)
62 * 8 Full create date (MMDDYYYY)
70 * 8 Full update date (MMDDYYYY)
129 2 Time of last update (seconds, 2 digits)
131 4 Time of last update HHMM
135 4 For keyed file: File length of I00 file (# of bytes, hex)
For object file: if NE "@00000000@" then it's a Comet32 object
139 4 Key position (extended keyed files only)
143 1 File type in hex (added in Comet 2005)
"@01@" = sequential file
"@02@" = contiguous file
"@04@" = keyed file
"@08@" = text file
"@24@" = extended keyed file
147 4 Position of object in library file (if object
file is bound)
- Full create date and update date added in Comet 504.239 and Comet98 Build 239.
Example: LENGTH 150 & LOCAL VALUE$ . VALUE$ = FSTAT("C1A",EXCP=9999)
This example shows how the FSTAT function can be used to obtain file status information for a file named "C1A".