home *** CD-ROM | disk | FTP | other *** search
- >&.Text.Document.FSVarsDoc
-
- Filing System Variables Module Documentation
-
- Package Version 1.00 17th July 1989
-
- This file documents the module FSVars (1.21, 17th July 1989)
-
- It contains three sections:
-
- - Using the FSVars Module
- Information about the module from the user's point of view
- - Technical notes
- Some information about the program and OS Bugs that were
- discovered during its writing
- * Package Documentation
- Information about the package in general. Read this.
-
- Document Version 1.01 17th July 1989
-
- --- Using the FSVars Module
-
- To install the FSVars module simply type
- *FSVars
- at any prompt. You can include it in your boot file if you want. As soon as the
- module is installed then the following OS variables are available
-
- - FS$Name
-
- This holds the name of the currently selected filing system. It can be
- both read from and written to:
-
- Examples:
-
- >*SHOW FS$Name
- FS$Name : ram
- >*SET FS$Name adfs
- >
-
- - FS$Disc
-
- This holds the name of the currently selected disc. It can only be
- read.
-
- Example
-
- >*SHOW FS$Disc
- FS$Disc : MainHard
- >
-
- - FS$Path
-
- This holds the current full path as related to $ (the root directory).
- It can only be read.
-
- Examples:
-
- >*SHOW FS$Path
- FS$Path : $.M/Code.Source
- >*DIR $.old.c.c
- >*SHOW FS$Path
- FS$Path : $.Old.C.C
- >*DIR $.a*
- >*SHOW FS$Path
- FS$Path : $.Aasm
- >
-
- - FS$Dir
-
- This holds the current directory name only. It can be written to.
-
- Examples:
-
- >*SHOW FS$Dir
- FS$Dir : Source
- >*DIR $.old.c.c
- >*SHOW FS$Dir
- FS$Dir : C
- >*DIR $.a*
- >*SHOW FS$Dir
- FS$Dir : Aasm
- >
-
- - FS$Full
-
- This holds the current full currently selected directory specification.
- It is in fact defined as '<FS$Name>::<FS$Disc>.<FS$Path>'. It cannot be written
- to.
-
- Examples:
-
- >*SHOW FS$Full
- FS$Full : adfs::MainHard.$.M/Code.Source
- >*DIR $.old.c.c
- >*SHOW FS$Full
- FS$Full : adfs::MainHard.$.Old.C.C
- >*dir ram:$.Library
- >*SHOW FS$Full
- FS$Full : Ram::RamDisc0.$.Library
- >
-
- - Suggested uses
-
- My use for this module is in setting up a Cli$Prompt. My current one is
- *SetMacro Cli$Prompt <Sys$Date> <Sys$Time><13><10><FS$Full> *
- which I like. I have also used
- *SetMacro Cli$Prompt <Sys$Date> <Sys$Time> <FS$Full><13><10><FS$Dir> *
- which leaves more space on the input line.
-
- If you used to use a BBC Master and still prefer the -adfs- convention
- rather than adfs: then you can always change FS$Full (even in the source code
- if you want) to
- *SetMacro FS$Full -<FS$Name>-:<FS$Disc>.<FS$Path>
-
- - Thanks
-
- I'd like to thank Alan Glover of Eureka II (01 683 0629, 3-24 8N1) for
- helping me check that the OS bug described later really was an OS bug, and
- Philip Colmer of Acorn for his help in providing the solution to this.
-
- --- Technical Notes
-
- The hardest part of this program is getting FS$Path. The problem with
- the Arthur/RISC OS operating systems is that there are holes in the read info
- type calls at various places. For instance, you can't read the name of a
- directory except the current one and the current library. This means that it is
- impossible to find the name of the parent of a directory without changing
- dir/lib oneself. Changing directory is no good: Some filing systems maintain
- a previously selected directory (psd) and since you can't read this *at all*
- any change of directory loses the last psd *for ever*. This means that the
- only thing we can change is the library. Fortunately there is no previously
- selected libaray!
-
- To find a directory, then this is what we do:
- Make sure we always know the *full path* of the library. This is done by
- building a path by calling getlibname followed by doing Lib %.^ until lib is
- $. This means we can always move the library and get back to it (with some
- checks on the *NoLib status).
- When we need to know the full path of the currently selected directory (csd)
- do *Lib @ followed by getting the full library path to a different buffer. We
- can get back to the old library by using the already known library.
-
- As can now be seen, we have to change the lib in the read entry of our
- variable now. (OS_FSControl 1). At this point a bug in Arthur/RISC OS became
- apparent. Changing Library within FSControl 1 caused a crash due to a clash of
- workspace. Consultation with Acorn revealed a solution to this which is rather
- messy: You have to copy the whole of &4000 to &7FFF to a storage area as the
- variable code begins and restore it at the end. Fortunately the ARM is fast and
- the delay isn't very great.
-
- When trying to check when the Filing System changed I discovered that,
- at least in RISC OS, Service_StartUpFS is never issued. In the end I hooked
- onto FSControl 14 and 19 instead, but the lack of this service is odd:
- I haven't seen its death docced anywhere.
-
- Implementing FS$Name opened another can of worms. There is a well
- documented call to get the current filing system number but no call in the PRM
- to get the filing system name or to convert this FS number to a name. So I
- disassembled *Configure FileSystem. In RISC OS this calls FSControl 33 which (I
- later remembered) is in the provisional RISC OS documentation I have here. I
- then wanted to find something to use in Arthur 1.2, so I loaded up a copy of
- FileSwitch 1.04 from Arthur and disassembled Configure FileSystem from there.
- This code uses the fact that the FS name is stored &3d into the FS control
- block returned by FSControl 13. This assertion is also true in RISC OS but
- for best compatibility I used this method if FX0,1 returned less than 6 (the
- value it returns for RISC OS).
-
- --- Package Documentation
-
- *** Users of other shareware written by me please note - the text below may
- *** look the same as others but it is not. Take a few moments to look through
- *** it for differences, please.
-
- This package contains:
- FSVarsDoc 1.01 (17th July 1989) : This text file
- FSVars 1.21 (17th July 1989) : Module
- SFSVars 1.21 (17th July 1989) : BASIC Asm Source code for module
- Macros (26th April 1989): BASIC m/code Macros
-
- The software contained in this package is Shareware. The word 'Shareware'
- means many things to many people, so I'll explain what I mean. In fact, some
- people would call this 'freeware' or 'public domain software' but it hardly
- matters what you call it - your obligations are set out below.
- The program is free. You may make any number of copies and give them away to
- anyone (subject to the condition that you give them ALL the files in the
- package). You may not sell this software, or use it otherwise for personal gain
- without my permission. If you wish to post it on your Bulletin Board or include
- it in your Shareware library then that, too, is fine.
- If you want to add any part of the code or data to one of your programs for
- your own use, then that's fine too. If you want to add it to something you plan
- to sell, or otherwise release as copyright material (whether for gain or not)
- then you'll need my permission - I retain copyright on this program.
- If you like this program and find it useful then I would appreciate a small
- donation (say 5 or 10 pounds) (since this took a lot of labour to get working).
- This donation is a voluntary contribution.
- If you send a donation and say which version of the package you have then I
- will send you an update if there is one. This disc will also contain up-to-date
- copies of as much of my shareware as will fit, plus any other stuff I can fit.
- There may be no update, since, for the moment, I've done all I want to to this
- program. Thus I don't guarantee that, if you send me money, I'll send you a
- new version of the program. You will, however, get a disc with things on it. If
- you'd prefer to wait until there is a disc with a new version on it then please
- say so. In this case you'll get a thankyou note.
- This program has been tested with RISC OS. It should be suitable for both
- Arthur 1.2 and RISC OS. Please state, when sending for updates, whether you
- have RISC OS.
- The diversity of Filing Systems and other modules means that I am unable to
- test this module as fully as I might like. However, it has been running bug
- free on my machine (even under RISC OS) for some time now.
- This software carries no warranty, either express or implied. I've tested it
- and, to the best of my knowledge, there are no bugs. If you come across a bug
- then I'd be delighted if you got in touch with me. I can't guarantee to fix it
- but I'll probably have a good try.
- My address is:
- Martyn Lovell
- 16, Fairwater Park,
- Barnwood,
- Gloucester.
- GL4 7HF
- No telephone calls please.
- However, I can be contacted as:
- Cix: MartynL
- Janet: ZCEEB02@UK.AC.UCL.EUCLID
- Interspan: Contact via Janet at above address
- Eureka II: Martyn Lovell (112)
- Note that, during university terms, I read all this EMail sites regularly but
- in the holiday periods I may read them less regularly.
- For bug reports please send the following information:
- Machine Type
- Arthur Version
- Software Version
- Screenmode in use
- Had the code been modified (if so, try to explain how)
- What *exactly* happened
- Modules Installed
- Modules Unplugged
- Podules Installed
- Drives Installed
- RAM Available
- Monitor Type
- Path values
- Filing Systems and versions
- Variable in use
- Is the bug repeatable?
- and everything else that seems relevant.
-