FILEATTR Function ---------------------------------------------------------------------------- Action Returns information about an open file or ISAM table. Syntax FILEATTR( filenumber%, attribute%) Remarks FILEATTR returns information about an open file or ISAM table, such as the DOS file handle and whether the file was opened for input, output, random, append, or ISAM binary mode. The FILEATTR function uses the following arguments. ----------------------------------------------------------------------------- Argument Description ---------------------------------------------------------------------------- filenumber% The number used in the OPEN statement to open the file or ISAM table. You can use a numeric expression as long as BASIC evaluates it to the number of an open file, device, or ISAM table. Argument Description ---------------------------------------------------------------------------- attribute% Indicates the type of information to return about the file or table. When attribute% is 1, FILEATTR returns a value indicating the file's mode (see below). When attribute% is 2 and filenumber% indicates a file, FILEATTR returns the DOS handle for the file. When attribute% is 2 and filenumber% indicates an ISAM table, FILEATTR returns 0. The following table lists the return values and corresponding file modes when attribute% is 1. ----------------------------------------------------------------------------- Return value Mode ---------------------------------------------------------------------------- 1 Input 2 Output 4 Random access 8 Append 32 Binary 64 ISAM See Also OPEN (File I-O) Example The following example opens a file and displays its DOS file handle and mode. OPEN "tempfile.dat" FOR APPEND AS #1 PRINT "Handle. "; FILEATTR(1,2); " Mode. "; FILEATTR(1,1) Output Handle. 5 Mode. 8