.INF file format ================ The '.INF' metadata file is a method of storing Acorn/BBC metadata on filing systems that otherwise cannot store it. It is a text file with the same name as the data file, with a '.inf' or equivalent filename extension. It contains several space-seperated fields with the real filename followed by the file's metadata in upper case hexadecimal in the following order: filename load exec length access modification_date modification_time creation_date creation_time user_account auxilary_account crc It can be seen that 'load' to 'modification_date' are the standard contents of the OSFILE control block. The additional fields follow on logically. The date and time files are in filing system format. Any fields can be progressively dropped from the righthand end of the string, and a short '.INF' string just contains the first four fields: filename load exec length When output the filename is left padded within 11 spaces (or more if the filename is longer than ten characters), there is exactly one space between the data fields, and the data fields are the full number of digits - 8 digits for the addresses, 2 digits for the access byte, 4 digits for dates, 6 digits for times. When reading, extra spaces and extra fields must be ignored silently. Fields may have leading zeros omitted. If a field is omitted or there are extra unrecognised fields, the application must silently ignore them. For example, if there is no access byte, then the access on the extracted file should be left as whatever the filing system sets it to. If the modification date is omitted, then the modification date on the extracted file should be left to whatever the filing system sets it to. However, if the exec address is omitted, it is sensible to set it to the same as the load address. All the following are valid INF files: filename FFFF1900 filename FFFF1900 FFFF8023 filename FFFF1900 FFFF8023 00001273 filename FFFF1900 FFFF8023 00001273 33 filename FFFF1900 FFFF8023 00001273 33 7B23 filename FFFF1900 FFFF8023 00001273 33 7B23 123106 filename FFFF1900 FFFF8023 00001273 33 7B23 123106 7B20 filename FFFF1900 FFFF8023 00001273 33 7B23 123106 7B20 112708 filename FFFF1900 FFFF8023 00001273 33 7B23 123106 7B20 112708 0100 filename FFFF1900 FFFF8023 00001273 33 7B23 123106 7B20 112708 0100 0040 On reading, extra spaces and ommitted leading zeros must be ignored. The following are valid INF files: filename 04000 4010 12B filename 4000 00004010 012B filename 00004000 00004010 0000012B As a special case, the access byte may be a string starting 'L' to represent '19' for Locked on DFS. When writing to a DFS disk only bit 3 is written. Some applications allow a CRC field, which must come after any numeric fields. The CRC is the 16-bit CRC used by the CFS/RFS filing system. It has a special format CRC=hexnum, for example: ProgramOne FFFF1900 FFFF8023 00001273 CRC=02A5 Some applications allow a BOOT field holding the disk boot option. Most applications only expect to find this field in the INF file for a !BOOT file. Again, this field must come after any numeric fields and has a special format BOOT=n, for example: !BOOT FFFF00A8 FFFF00A8 00000008 BOOT=2 Programs that read INF files that expect BOOT and CRC to be in a specific order expect any BOOT entry to be after any CRC entry, so if writing both entries, CRC must come before BOOT: !BOOT FFFF00A8 FFFF00A8 0008 CRC=02A5 BOOT=2 Some applications also use a single metadata file to hold all the metadata for all the files in a directory. There does not appear to be a consistant name for this file. Being space-seperated fields, INF files can be parsed with the same code used to parse a command line, for example, using the CmdLine library: A$=inf$ opt$="":A%=INSTR(A$,"BOOT="):IF A%:opt$=MID$(A$,A%+5):A$=LEFT$(A$,A%-1) crc$="":A%=INSTR(A$,"CRC=") :IF A%:crc$=MID$(A$,A%+4):A$=LEFT$(A$,A%-1) name$ =FNcl("",0) load$ =FNcl("",0) exec$ =FNcl("",0):IF exec$="":exec$=load$ length$=FNcl("",0) attr$ =FNcl("",0):IF LEFT$(attr$,1)="L":attr$="19" ELSE IF attr$="":attr$="33" mdate$ =FNcl("",0) mtime$ =FNcl("",0) cdate$ =FNcl("",0):IF cdate$="":cdate$=mdate$ ctime$ =FNcl("",0):IF ctime$="":ctime$=mtime$ acc$ =FNcl("",0) aux$ =FNcl("",0):IF aux$="":aux$=acc$ Normally, the name and length fields in an INF file would be ignored, with the actual file's name and length being used. See also ======== Metadata mdfs.net/Docs/Comp/BBC/Filing/Metadata ZipToInf mdfs.net/Apps/Archivers/ZipTools SJFiler mdfs.net/Apps/Networking/MDFS SoftMDFS mdfs.net/Apps/Networking/FServers HostFS mdfs.net/Software/Tube/Serial