Q5 The filing systemq Qutilitiesq   There are a number of utilities supplied on the HADFS System disk. Some of these are machine code and some are BASIC programs. Programs in sub- directories of the library directory can be run just like the main library programs. This allows you to group collections of similar commands together in subdirectories instead of creating an ever-lengthening library directory. If there is a file I%.Progs.RunMei then using B*Progs.RunMeb will call it. You have to bear in mind that some alphabetic sequences with a full stop directory separator may be interpreted as an abbreviation for a ROM-based command. For example, I*K.Progi will be matched as B*KEY Progb. The programs and utilities supplied on the system disk are as follows: Library: (HADFS utilities) Backup, Compact, Copy, Disks, Files Library: (File utilities) CLoad, CSave, FileInfo, Filer, PrList, Repeat, ScrLoad, ScrSave, SetLoad, SetExec, SetType, SrLoad, SrSave, Stamp, TreeCopy, TxSave, XTree Library: (General utilities) Break, Crunch, Disp, Explode, Link, lp, lpS, MakeLP, MCode, MDump, Mouse, pc8s, Repair, ROMS, Scroll, Show, VList Utils: DMap, HDInit, HEdit, HUtils, MCat, MkIntern, MkMap, Rescue, SetDate, VisCompact, Wiper Extras: DemoArgs, DemoGbPb, Examine, FSTest, RSImgFile, RSLink/s, Support/s There may be more than the list given here. Any extra files and programs will be detailed in accompanying text files, and they will be mentioned in a I$.!ReadMei text file. The ILibraryi HADFS utilities are for using with HADFS. The ILibraryi file utilities can be used on any filing system for accessing or giving information about files. The ILibraryi general utilities can be used on any filing system. The IUtilsi and IExtrasi are HADFS programs. The library commands B*Copyb, B*Disksb, B*Filesb, B*SetExecb, B*SetLoadb, B*SetTypeb and B*Stampb are detailed in Chapter 3. XHADFS Library Programsx The following are programs designed to run with HADFS. DBACKUPd This program will copy an entire HADFS or DFS disk sector by sector, ignoring the file structure. Any faulty sectors on the source disk are ignored. The destination disk must already be formatted the same as the source disk. BBACKUPb can take the following command line parameters: BBACKUP -s -t -quit b If the Bb and Bb drives are given, both must be given. If the number of tracks and sides are given then both must be given. The single character options must be given in lower case. The Bb option is the number of sectors per track, currently only 10 is implemented. The Bb is the number or retries BBACKUPb uses before abandoning a disk read or write. The Bb and Bb can be filenames, in which can a disk image will be read from or written to. For example: B*BACKUP 0 -net-DiskImg 80 2b will copy the disk in drive 0 to a 400K disk image. Disk images are 'sequential/noninterleaved', that is, all the tracks on one side are used before all the tracks on the other side. Filenames can be prefixed with Bfs:b instead of B-fs-b, eg Bnet:DiskImgb. The B-quitb option can give a file to run on exit. If the name starts with a B*b, then it is called as a B*bCommand, otherwise it is CHAINed. If no parameters are given, you are prompted for the source and destination drives. These can be the same, in which case you will be prompted to change disks. You are then prompted for the size of the disk, the number of tracks, the number of sides and the maximum number of retries to use. If ERETURNe is pressed, then the defaults are used. Once all these are entered, the program waits for a keypress before starting. DCOMPACTd As a disk is used, as files are created and deleted, the free space on it may get fragmented until a stage arrives where there may be enough space to save a file, but none of the small areas of space are individually large enough. The BCOMPACTb program tries to move all the files on a disk together so that the free space is in the largest areas possible. BCOMPACTb can take the following command line parameters: BCOMPACT -quit b The B-quitb option can give a file to run on exit. If the name starts with a B*b, then it is called as a B*bCommand, otherwise it is CHAINed. If no parameters are given, you are prompted for the drive number to compact. It then looks through the entire disk and moves as much as it can to compact the disk. It can only move files that will fit into memory, so the compaction may not be the maximum possible. DRescued This program can be used to rescue a file that has been corrupted and made inaccessible due to disk errors. You are prompted for the filename of the file to rescue, the new filename to save the rescued file as (don't use the same one!) and the fill byte for bad sectors. You give a decimal number or a hexadecimal number prefixed by '&'. If you just press return, then the bad sectors are not filled, but the beginning is marked with '!!!!!!!!' and the end is marked with '********', and any control codes other than CR (13) are converted to '|'. Rescue can only rescue files that are short enough to fit into memory. It goes through the file, loading it sector by sector, listing any bad sectors. After rescuing the file, you can try to repair it. For example, with text files use either fill byte 13 or nothing, and then load or read it into a word processor to edit the damaged section. For BASIC programs, use no fill byte, and then use B*REPAIRb to repair the bad program, and then edit the damaged section. After rescuing a file, don't delete it. B*RENAMEb it somewhere out of the way, eg as I$.BadSectors.File1i. This will hide the bad sectors from other files. If you deleted it, the the free space would be returned to the Free Space Map, and you could attempt to save into the bad sectors again. If you get a lot of bad sectors on a disk, you should copy off the files to another disk and re-format it. If that doesn't solve the problem, you should throw the disk away and replace it. Regular disk-drive cleaning reduces disk errors considerably. XHADFS Utils programsx These programs provide utilities to be used with HADFS. DHUtilsd HUtils provides some extra utilities for use with HADFS disks. On running, if no date is set, you are asked to enter the date. Then the main menu appears: 1 : Initialise a new HADFS disk 2 : Alphabetically sort a directory 3 : Convert a DFS disk to HADFS 4 : Set drive boot options 5 : Check disk dates H : HADFS Info D : Disk info You can also press 'B0b' to exit, and 'B*b' to enter B*b-commands. Option 1: Initialise a new HADFS disk. This option allows you to create a new HADFS disk with a partition for DFS files. This option also allows you to reserve a partition in the HADFS disk for DFS files. The usual thing to do is, with a double-sided 80 track disk, is have HADFS files on side 2 and DFS files on side 0. You do this by starting the 'hole' in the HADFS map at sector 74, just after the I$i directory, and extending it all the way to the end of that side of the disk. The HADFS disk map then continues from sector 800 to sector 1599. You can then save up to 27 other files in the DFS catalogue. The I!Booti file is renamed as IHADFSi and the I'D I S K'i file as I'H.D I S K'i. TheIROMi file stays as IROMi. This way, you can have other DFS files, including a I!Booti, and doing B*HADFSb from DFS will either select HADFS if it is already loaded, or load the IROMi image file, as the HADFS I!Booti would do. Option 2: Alphabetically sort a directory. HADFS disks at present do not store the directories alphabetically. It is intended that in future they will be, but at present you can use this option to alphabetically sort a directory. The case of names is ignored in sorting. Option 3: Convert a DFS disk to HADFS This will convert a DFS disk to an HADFS data disk. You are asked for the size of the disk, and whether you want to convert both sides. There needs to be some space on the disk on track seven for the HADFS root directory, so if track seven is occupied, the files will be moved out of the way. If they cannot be moved (the disk is too full) you may have to B*COMPACTb the DFS disk. If that does not free up sufficient space, you will have to remove some of the files. The files from side 0 are put into directory I$.Side0i, and those from side 1 into directory I$.Side1i. DFS directories other than I$i are pre-pended to filenames in the same way as ITreeCopyi, so that IB.FREDi becomes IB/FREDi. Option 4: Set drive boot options This allows you to specify which drive HADFS defaults to on start-up or after B*MOUNTb. This disk's current settings are displayed, and you can change each of them. If more than one drive is set as the default drive, then the lowest number drive is used. The CSD drive is the drive defaulted to after startup or B*MOUNTb. The LIB drive is the drive to look for I$.Libraryi on before searching the CSD drive. The URD drive is the drive to look on with B*I AMb before searching the CSD drive. Option 5: Check disk dates HADFS before version 5.50 could not store dates after 2012. HADFS 5.50 and later can store dates in the whole 7-bit Acorn range of 1981 to 2108. This option scans a disk and fixes and dates stored by earlier versions of HADFS that would be misinterpreted by later versions. Option H: HADFS Info This option shows various information about the version of HADFS in the machine. It shows the version number and capability bits returned by OSARGS &FD,0. This function is also contained in the program IExtras.PrInfoi. Option D: Disk Info This reads the flag bytes of a disk and shows what type it is. DHEditd IHEditi is a DFS/HADFS disk sector editor. When run, it loads sector &46, the root sector if an HADFS disk, or sector zero if not. Keys: cursors keys move around Shift-cursor keys move to next sector TAB swaps between ASCII entry and HEX entry COPY swaps which half of the sector is displayed f1 select drive f2 select absolute HADFS-style sector number f3 select track f4 select sector within the current track f6 Chain HUtils program Escape exits program Ctrl-D search for a Directory Ctrl-F display HADFS File information under cursor Ctrl-G Goto file's start sector Ctrl-H display Help information Ctrl-O OS command Ctrl-S Save sector Ctrl-U go Up from a directory When moving to a different sector or exiting, you are given the opportunity to save the current sector to disk, so Esc can be used as a 'save this sector' key. DDMapd IDMapi graphically shows the layout of all the files on a floppy disk. DVisCompactd A combination of ICOMPACTi and IDMapi. Graphically shows the layout of a floppy disk while it is being compacted. Needs quite a lot of memory, so needs shadow screen memory available. It takes the same command line parameters as BCOMPACTb. DMkInternd IMkInterni creates an internal ROM-drive thet can be loaded into sideways RAM. It utilises the OSWORD 90 calls implemented by HADFS to allow extra drives to be added. When run, the following prompts are given: Drive number: The drive defaults to drive BIb. To change this, enter a drive number/letter here. Disk name: To change the default name, enter a new name here. Make default drive? Enter drive number: If set to 'Yes', then after a B*MOUNTb, then the specified drive will be the default drive. Make default library drive? Enter drive number: If set to 'Yes', then the specified drive will be looked for for a Library directory before any others. Make default user drive? Enter drive number: If set to 'Yes', then the specified drive will be looked at first when doing any B*I AMb commands. Boot option: This will set the option to use if the drive is booted from. Make files externally runnable? If set to 'Yes', then any file with a public 'Brb' access will be able to be called as a ROM-based B*bcommand without HADFS being selected as a the current filing system. Once these are entered, files can be loaded into the ROM image. You are given a prompt which shows how much space and directory space is left. B*bCommands can also be given at this prompt, eg to change directory. The file I$.Extras.IntRomi is a ROM with the supplied Library in it DDemoGBPBd This demonstates calls to OSGBPB to read various information. It runs through all the calls from 5 to 255, and displays the returned information. This will also work on other filing systems to demonstrate what is returned. DDemoArgsd This demonstates calls to OSARGS to read HADFS context parameters. XGeneral Programsx These programs should work any machine, including RISC OS systems, and on any filing system. DTreeCopyd ITreeCopyi will copy files between filing systems, preserving the directory structure, file attributes and creation/modification dates as much as possible. The program is quite easy and self-explanatary to use. It has been completely rewritten to be fully error-trapped, allow disk swapping, and it reads as many files as possible before writing, thereby reducing disk swaps. When asked for filing systems or directory names, you can enter a *command by starting it with a B*b. When run you are prompted for the source and destination filing systems and directories, and a set of copying options. ITreeCopyi can also take the following command line parameters, which must be in this order: B*TreeCopy (:) (:) ACEPRS (-dest) (-quit (*))b An example command line would be: B*TreeCopy HADFS::0.$ NET::USER.$.Disk1 ~C~PR -quit %.MenuProgb or BCHAIN "TreeCopy DISK::0.$ HADFS::4.BACKUP.Disk1 A~C~PS -quit %.MenuProg"b The Bb and Bb directories can be prefixed by a filing system name terminated with a B:b, eg BHADFS::0.$b The single character options control the level of copying: A - Copy all DFS directories C - Confirm (default off) E - Expand DFS directories P - Pause to change disk (default off) R - Recurse (default on) S - Put in subdirs They can be prefixed with 'B~b' to turn off the option, eg B~Cb means no confirm. If the B-destb option is given, then ITreeCopyi will terminate with the destination filing system selected. Otherwise, the source filing system remains selected. The B-quitb option can give a file to run on exit. If the name starts with a B*b, then it is called as a B*bCommand, otherwise it is CHAINed. * When 'C'onfirm is selected, you are prompted Yes/No/All to copy each file and directory. If you select 'All', then confirmation is tuened off and all further files are copied. * When copying to DFS or DFS-like filing systems filenames are shortened to seven characters. * When copying from DFS or DFS-like filing systems the 'Copy all DFS directories' option allows you to copy the whole disk, creating an approximation of the DFS directory structure by putting all the non-I$i directories into subdirectories. * Selecting the 'Put into subdirs' option will copy DFS files into subdirectories for each non-I$i DFS directory. Turning this option off will save files in the destination directory prefixed with "x/", where x is the DFS directory. For example, the DFS file BB.Progb becomes BB/Progb. * When copying to DFS or DFS-like filing systems selecting the 'Expand into DFS directories' option will copy files with a "x/" prefix into the DFS directory "x". For example, the file BB/Progb becomes the DFS file BB.Progb. Creation and modification metadata is recognised on Acorn File Server, SJ MDFS Filer Server and HADFS. If copying from to a filing system with less metadata then the unsupported metadata will be lost. If copying to a filing system with more metadata then the creation and modification dates are set the same. DXTreed IXTreei will display an expanded tree display of the directory structure. When run, IXTreei asks for the path of the directory to display. At this prompt, you can also give command line option flags. If you did not given any option flags when entering the path, you are then asked whether to show files (or just directories) and file information, and whether to print out the display. If you select printing, then the characters used are those suitable for printing on a printer that has characters 128 to 255 set to PC-8 characters. If there is any information available on the disk root, it is show. At the end, the total space used by the directories and files looked at is show. If you use the B-countb option, then all directories will have their contents added up and the total shown individually. IXTreei can take the following command line parameters, which can also be entered at the 'Path to show:' prompt: B*XTree path [-files] [-info] [-count] [-list] [-print]b The option flags must be in lower case, and only the first letter is significant. If there are no parameters, IXTreei asks for them. XLibrary File Utilitiesx These transient utilities can be used on any filing system for accessing or giving information on files. Information about these commands is given in the file I$.Extras.Library/ti. XLibrary General Utilitiesx These transient utilities and MCoded Basic programs can be used on any filing system. Information about these commands is also given in the file I$.Extras.Library/ti. XPrintout Programsx Most of the text files supplied on the System Startup disk are extended View files. These are text files created with Acorn's View word processor, using extensions to highlight two to provide easier-to-use printer functions. IMakeLPi creates the B*lpb commands to print out the files (replacing View's BPRINTb command), B*lpSb can be used to show the effects on the screen (replacing View's BSCREENb), and BScrollb can be used to scroll though a text file of any length, again showing the effects. DMakeLPd This program creates the Blpb command to print out View or text files to a printer. The name Blpb comes from Unix - it's short for ELeine EPerinter. IMakeLPi allows you to create a customised version of Blpb tailored for your printer and for what effects you wish to use. The default settings are for Epson-compatible printers. Blpb extends View's highlight 2 to give the extra facilities. After a highlight 2 you put a letter indicating an effect. A capital letter turns it on and a lower case letter turns it off. As an example: using *Ihello*i would put the word 'hello' in italics. Pound symbols are correctly printed (hurray!!) - for this you need your printer set in US mode. This is done by setting some DIP switches somewhere, usually the endmost three to 'off'. Check your manual on this. The pound symbols are printed by switching to UK, printing a '#', and then switching back to US. As with everything else, this can be changed. The program is fairly simple to use. There is a main menu with a few options. Option 5 - Create View Driver - is not yet implemented. Options 1 and 2 allow you to change the parameters for your printer. Options 3 and 4 allow you to save and load the settings, and option 6 creates an Blpb command. The actual name can be changed to anything reasonable. I recommend creating a Ilpi directory in the Library, and naming the commands I%.lp.nlqi, etc. The System Startup Disk has various files supplied in the I%.lpi directory. On option 1, you have some Yes/No questions and some value questions. Pressing BRETURNb leaves them as they are. You may have to experiment a bit to find what the correct values are for your setup. There are some supplied files for different lengths of paper and number of lines on each page. Text lines Page lines Supplied files Continuous A4 70 70 I%.lp.70A4 %.lp.70A4nlqi Standard A4 66 70 I%.lp.66A4 %.lp.66A4nlqi Short A4 60 70 I%.lp.60A4 %.lp.60A4nlqi Continuous Listing 66 66 I%.lp.66 %.lp.66nlqi Standard Listing 60 66 I%.lp.60 %.lp.60nlqi These are the files used by the JGHPD ViewHello View menu system. On option 2, you select the code string you want to alter with the cursor keys. To change the string, type in the new string. The input is fairly flexible. You can put commas between everything, or not. You can enter in characters or decimal. If you want the number characters "0" to "9", they must be surrounded in quotes, otherwise they are taken as values. Examples are: 27,S,"0" \ 27,S,48 } all the same. 27,83,48 / To remove a setting, press ESPACEe followed by ERETURNe. The setting should then disappear. Pressing ECOPYe will allow you to edit the settings for punctuation and numbers. When Blpb starts it does a '@' code. This is defined to reset the printer, and can also set it to NLQ if you want. This makes the current position on the paper the top of the form (the place where Form Feeds go to). If you don't want this, set '@' to nothing. Blpb ignores View's ruler and embedded commands, etc. Tabs are to 8 character positions, as on the default ruler. The syntax of Blpb is: B*lp (+) ()b If the 'B+b' prefix is given, Blpb double spaces. If a decimal Bb is given, then that number of copies are printed. You can press BEscapeb at any time and the print job will be terminated, but the printer itself may continue for a while as it empties its own buffer. Hints If your printer prints everything on the same line, you need to set IAuto linefeedi to IYesi from option 1. If it doublespaces when you don't ask it to, you need to set IAuto linefeedi to INoi. If your printer form feeds to much, set IForm feedsi to INoi. The following are Highlight 2 extensions that are used in most of the text files, and so I recommend you set them to do a suitable effect on your printer. Bb BBoldb on/off Main bold effect Cc CCondensedc on/off Dd DDouble-striked on/off \ Auxilary Ee EEmphasidede on/off / bold effects Hh HDouble Heighth on/off Ii IItalicsi on/off Qq QQuad sizeq on/off This takes 3 lines (That bottom line ^^^^ has to be blank for Quad to work on the LC10/1001) Ss SSuperscripts on/off, as in dates: 3Srds March Ww WWidew on/off Xx XWide X Highx Yy YSubscripty on/off also: Highline One is used for underline Pound: ` Hash: # D*lpS (-) d The BlpSb command will display a text file to screen, taking account of the following effects: BBoldb, IItalicsi, SSuperscripts, WWidew, YSubscripty and Underline. If a Bb parameter is given, then each page is split with a line of '=' characters. DScrolld IScrolli is a scrolling textfile reader. You can scroll upwards and downwards through text files of any length. Extended View highlight codes as used by B*lpb and B*lpSb are acted on to give Bboldb, Iitalicsi, Ssuperscripts, Wwidew, Ysubscripty and underline effects. These can be turned off to give plain View extensions of *bold* and underline. IScrolli will also run on RISC OS. If there is enough memory, IScrolli uses shadow screen mode 0, otherwise mode 3 is used. Unless a command line file is given, IScrolli shows the current directory and asks for a filename. At this prompt you can also give B*bcommands to change directory, etc. Once a file is given, it is loaded and displayed. The keys are simple. Cursors move up and down. Pressing EShifte will jump one screen at a time. Pressing ECtrle will jump to the ends of the file. Pressing ECOPYe will flip between extended highlights and plain highlights. Pressing EEscapee will leave. Pressing EPe and ERETURNe will let you print out the file. Before you press ERETURNe a prompt appears telling you the name of the printout command. You can change this here by deleting it and typing in another comand, but IScrolli will usually have found a suitable one. The recommended command B*lpb comand is created with the IMakeLPi program. Pressing E4e will display the file in 40 column teletext mode, if IScrolli has been told what program to use. The bottom line of the screen shows the filename of the file being scrolled, a percentage figure showing how far through the file you are, and a reminder of the keys used. IScrolli will take the following command line arguments: B*Scroll (-lp ) (-4 ) (-p ) (-quit )b Bb is the file to display. The B-lpb option gives a command to use to print out the file. If this option is not given, then a default printout command is looked for as detailed below. The B-4b option gives a command to use to display the file in 40 column teletext mode. The B-pb option gives a pagelength to use when displaying page breaks. The B-quitb option gives a command to run on exit. If the Bb starts with a B*b, then it is called as a B*bCommand, otherwise it is BCHAINbed, with any parameters passed via the keyboard buffer. The options must be in lower case, and only the first letter is significant. So, for instance, to call IScrolli from another program, you could use the following: B CHAIN "Scroll -4 $.3to7 "+name$+" -quit Menu"b This would run BScrollb and display the file Bname$b, and CHAIN the program I$.3to7i to display in teletext mode. On exit, it would return to the program BMenub. On starting, if no B-lpb option is given, IScrolli looks for an B*lpb printout program. The order it looks for one is: Ilpi, I%.lpi, I%.lp.#i, I%.lp.*i, I$.lpi, I:0.$.lpi. The recommended place to put the B*lpb command is in the library in a subdirectory I%.lpi, with a file I1i being a default general purpose printer. With DFS, the best place would be in the I$i directory. IScrolli consists of the following files: IScrolli - The program Idispi - Controls screen output giving display effects