Remarks |
filenum&
is the handle of a currently open file. fattr is an integer
between -3 and 3 that specifies the type of information required, according
to the following table:
fattr |
Definition |
-3 |
The device type.
Returns 1 for a file, 2 for a device. COMM, TCP
and UDP are classified as devices. |
-2 |
Logical first byte (base)
position of a disk file. By default, PowerBASIC opens files with
a default first location of 1, but this can be overridden via the BASE=
clause of the OPEN statement. This
function can be useful when the base is not known or when performing SEEK
operations. |
-1 |
The minimum amount of
data that can be read or written at one time. For RANDOM
files, it is the record length. For INPUT
files, it is the input buffer length (set with LEN= in the OPEN statement).
For BINARY, OUTPUT
and APPEND, there is no buffering,
so it always returns 1 (1 byte). |
0 |
The
open state. TRUE (non-zero)
if open, FALSE (zero) if closed. |
1 |
The file mode (which may
be a combination of the following): |
|
(for example, an APPEND file
will return 8 + 2 = 10). |
2 |
The operating system file
handle for the file. This handle can be used with particular Windows
API calls files to manipulate files opened with PowerBASIC, and with the
OPEN HANDLE statement. |
3 |
Enumerates existing file
numbers. This mode enumerates existing file numbers, in the range
of 1 to 32767. FILEATTR(1,3) returns the first located file number,
FILEATTR(2,3) the second, and so on until -1 is returned to indicate that
there are no more file numbers active. The file numbers returned
are not guaranteed to be returned in any particular sequence, nor be open.
You can use FILEATTR(#filenum,0) to determine whether a given file number
is open or closed.
The number symbol [#] is optional, but recommended for clarity. |
|