BLib.FInfo - Read Full File Information ======================================= File: FInfo - Update: 1.00 Author: J.G.Harston - Date: 15-Feb-1997 The FInfo library provides functions to read the full file metadata of filing system objects and translate file information. Requirements and Dependancies ============================= The library requires a global control block large enough to hold the data required for the calls accessible with X% holding the address of this block, and Y% holding X% DIV 256. A control block size of 128 bytes is sufficient for most calls, and is the largest than can be used with the Tube. This can easily be set up with DIM ctrl% 127 near the start of the program and X%=ctrl%:Y%=X%DIV256 at the begining of the major program code and at the start of any main program loop. FNf_info() also requires the FileIO and NetFS libraries. The FInfo reads full information on BBC/Master/RISC OS platforms and requires the FileIO library. The Generic.FInfo reads full information on BBC/Master/RISC OS/Windows platforms and requires the Generic.FileIO library. Read File Information ===================== DEFFNf_info(filename$) FNf_info() reads the full file information on the specified object. It returns the file type as follows: 0 - no object found 1 - file found 2 - directory found 3 - image file found (a file accessible as a directory) 4 - unresolved symbolic link found The block pointed to by X% is also returned holding the object's metadata: X%!2 = load address X%!6 = execution address X%!10 = length X%?14 = access byte X%!15 = modification date X%!17 = modification time X%!20 = creation date X%!22 = creation time X%!25 = user account X%!27 = auxilary account X%!29 = reserved The dates and times are returned in standard filing system format and can be extracted with the PROCf_time() and PROCf_date() functions. Convert access byte to access string ==================================== DEFFNf_access(access%, type%) FNf_access() returns a fixed 8-character file access string. For example, FNf_access(&33,1) returns "WR/wr ", FNf_access(8,2) returns "DL/ ". If you do not want bit 7 to be returned as a 'P' access bit, then mask it off with FNf_access(access%AND127,filetype%).