Test for DFS-like filing systems

From BeebWiki
Revision as of 23:50, 18 June 2010 by Jgharston (talk) ($ always exists on non-DFS systems.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

DFS is a cut-down filing system in many aspects. It does not support subdirectories, filenames are a maximum of seven characters and the access byte is mangled, amongst other things. Programs sometimes need to check if DFS is being used, for instance to avoid using *CDIR and to avoid using long filenames.

The usual way to do this is to read the currently selected filing system number and test if it is 4. However, with the development of other filing systems that present a DFS-like face, such as certain RAM filing systems, this test cannot always be used. Another test is needed.

Observing that "$" is a valid file name on DFS and that on all other filing systems "$" is a directory name which always exists, this can be used to test for a DFS-like filing system.

   dfs%=FNfile("$",5)<>2

The major difference between this test and using FNfs=4 is that this causes an access to the currently selected disk.

Jgharston 23:42, 10 July 2009 (UTC)