Q3 Filing systemq Qcommandsq   HADFS provides a variety of commands used to access HADFS disks. The following pages describe these commands. They are all B*b commands, and so must be at the end of a program line, or accessed using OSCLI from BASIC. Some of the commands are provided by HADFS as filing system commands, some of them are provided by HADFS as general utility commands, and some are provided by the MOS, which communicates with the HADFS filing system to implement them. There are also some commands that are in DFS on BBC Bs and in the MOS in Masters. There are also transient commands which are loaded from disk to run them. The commands are labelled as EFilinge, EUtilitye, EMOSe, ETransiente or EDFS/MOSe. All HADFS commands can be prefixed with BHb to prevent clashes. Commands can be prefixed with B\b to pass it to the filing system only, as with SJ Fileservers. HADFS commands can be terminated by any non-letter, so B*DIR $b is the same as B*DIR$b, but B*DIR FREDb cannot be shorted to B*DIRFREDb, this would look for a command file IDIRFREDi. DCommand Syntaxd The syntax abbeviations used in these descriptions, and in B*HELPb messages, are as follows: ambiguous file. A filename or directory name that can include the wildcard characters B#b and B*b. file specifier. A filename or directory name that does not include the wildcard characters B#b and B*b. source filename/dirname/drive. destination filename/dirname/drive. a directory. a user number. a drive number. If a syntax abbreviation appears in brackets, this indicates that it is optional. DFilenames and pathnamesd Filenames can consist of one to ten alphanumeric characters, containing no spaces, and none of the following special characters which are reserved and cannot be used in filenames: B"b, B#b, B$b, B&b, B^b, B:b, B*b, B.b and B@b. Pathnames consist of one or more filenames separated by B.b, optionally including the following absolute directory reference characters: B$b root directory, and disk prefix. Identical to B:b. B:b root directory, and disk prefix. Identical to B$b. B%b library directory (LIB). A filename can also contain B%b. B&b user root directory (URD). B@b currently selected directory (CSD). B^b parent directory. So the pathname B%.FREDDYb refers to the file IFREDDYi in the library directory, and B:1.HELLOb or B$1.HELLOb refers to the file IHELLOi in the root directory of drive 1. The B$b and B:b can be used interchangably. The B%b character on its own refers to the Library, otherwise it can be used as any other character, for instance B%PrintQb. The following wildcard characters are used: B#b matches any one character B*b maches any characters D*/ () MOSd B*/b is an abbreviation for B*RUNb except that B*RUNb only checks the current directory and B*/b checks the current directory and the library directory as with unrecognised B*bcommands. It is normally used to prefix a command to prevent a ROM version being used and force a disk-based version to be used. D*\ () MOSd If a command is prefixed with B\b it is checked against HADFS's filing system commands and is not passed on to the filing system. They will not be searched for on the disk or passed to other ROMs if they are not matched. This is the same as with SJ Fileservers. D*| MOSd A command starting with B|b is a comment and is entirely ignored. D*ACCESS Filingd This command changes the access string on a file, eg B*ACCESS MATHS WR/Rb Each letter in the access string refers to a different type of access allowed to the file: BLb - Locked => The file cannot be deleted or overwritten or renamed. BWb - Write => The file can be written to using random access. BRb - Read => The file can be read with LOAD or random access and can be executed with B*b, B*/b or B*RUNb. BPb - Private => The file cannot be seen by non-owners. BEb - Execute => The file can be executed with B*b, B*/b or B*RUNb. If there is no Read option, then the file can only be executed, and is a run-only file. The B/b character separates the owner's access (on the left) from the public access (on the right). You are the owner of a file if you own the directory that it is in. When a disk is B*INSTALLbed or B*FORMbatted, you own the whole disk. Ownership is changed using the B*ACCOUNTb command, and allows you to segregate files and simulate an network server environment using local disk drives. Saving a file on top of an existing file does not change the file's access setting. D*ACCOUNT () Filingd This sets the hexadecimal main and auxilary account numbers of a directory. The auxilary account number is specified in brackets, eg B*ACCOUNT $ 0 (0)b. Account numbers are 12-bit numbers, so can be 0 to FFF. When a disk is B*MOUNTbed, your account number is reset to 0, so to own any objects in directories that have had the account number changed, you must log into them using B*I AMb. D*BACKUP Programd B*BACKUPb makes an identical copy of a disk. It is implemented as a transient program and is described in Chapter 5. D*BUILD DFS/MOSd B*BUILDb opens a new file with the specified name and all subsequent lines of keyboard input are directed to the file. Input is terminated by pressing Escape. D*BYE Filingd This closes any open files and dismounts all the disks. You should always use this (or B*MOUNTb) before changing a disk. D*CAT () MOSd The B*CATb command provides a list (catalogue) of the files in the selected directory. The files are currently not listed in alphabetical order, but it is intended that they will be in the future. The top three lines contain information about the directory being catalogued. With the example below, the first line shows that the directory being catalogued is called BPROGRAMSb and the disk it is on is called BMyDiskOneb. The CSD is the root (B$b) and the library directory is called BLibraryb. B PROGRAMS (33) Owner 000 MyDiskOne Option 0 (Off) Dir. $ Lib. Library MATHS WR/R GAMES DL/ STARTUP LR/R START2 R/Eb D*CDIR Filingd This command creates a subdirectory. If the specified subdirectory already exists, then the command returns with no errors. If a file already exists with the same name then a BFile existsb error will be generated. The created directory has its access locked. D*CLOSE MOS/Utild This closes all open files and ensures any data in buffers is written to disk. It is identical to using BCLOSE#0b from BASIC. D*COMPACT () Programd This compacts a disk creating larger areas of free space. It is implemented as a transient program and is described in Chapter 5. D*COPY Filing/Transientd On the Master series, this command is implemented in the ROM using the MOS B*MOVEb command. On the BBC it is run from disk as a library command. It copies a specified file, creating another copy, leaving the original intact, eg: B*COPY Prog1 $.Fred.OldProg1b The B*MOVEb-based version uses only the private MOS memory, including any unused shadow screen memory, so the user program area is untouched. The disk-based version uses the HADFS buffers and the CFS buffers at &900 to &AFF in the I/O processor, so again the user program area is untouched. For copying multiple files and to other filing systems, use the transient program ITreeCopyi instead. See Chapter 5. D*DELETE Filingd This simply deletes an entry from the directory, eg: B*DELETE FREDb If the file is locked, the error BFile lockedb is generated. If you try to delete a directory that has entries in it, the error BDir. not emptyb is generated. You can only delete files in directories that you own. D*DIR () Filingd This command allows you to move between directories, eg: B*DIR PROGRAMSb The example selects IPROGRAMSi to be the Currently Selected Directory (CSD). Doing B*DIRb with no name will reset the CSD to the User Root Directory (URD), this usually being B$b, or the directory selected with B*I AMb. The CSD can be refered to in pathnames with B@b, eg: B*RUN @.FREDb This would run the file IFREDi in the CSD. D*DISABLE