BLib.FInfo - Read And Write 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. 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 FNf_time() and FNf_date() functions. Convert date and time into filing system format =============================================== DEFFNf_date(day%,month%,year%) DEFFNf_time(hour%,minute%,second%) FNf_date() returns the specified date as a 16-bit value in filing system. FNf_time() returns the specified time as a 24-bit value in filing system format. Extract date and time from filing system format =============================================== DEFPROCf_date(fsdate%) DEFPROCf_time(fstime%) PROCf_date() sets the variables day%, month% and year% to the date represented by the 16-bit filing system date fsdate%. PROCf_time() sets the variables hour%, minute% and second% to the time represented by the 24-bit filing system time fstime%.