qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
FILEATTR Function
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Returns information about an open file.
 
FILEATTR(filenumber%,attribute%)
 
    ■ filenumber%    The number of an open file.
    ■ attribute%     Specifies the type of information to return. When
                     attribute% is 1, FILEATTR returns a value indicating
                     the file's access mode:
 
                     Value   Mode
                     ═════   ══════
                     1       Input
                     2       Output
                     4       Random
                     8       Append
                     32      Binary
 
                     When attribute% is 2, FILEATTR returns the DOS file
                     handle.
 
Example:
    OPEN "TEST.DAT" FOR BINARY AS #1
    PRINT FILEATTR(1, 1)
    CLOSE
 
See Also    OPEN