RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

FileSwitch Accessing File Systems

Programmer's Reference Manuals
» Part 4 – Using Filing Systems
» FileSwitch
» Technical Details
» Accessing Filing Systems

Accessing Filing Systems

Filing Systems

Accessing objects within different filing systems can easily be achieved by specifying the file system by suffixing a ‘:’ character to the name of the file system. This is the preferred method of specifying filing systems.

It is also possible to specify filing systems by encapsulating the file system name within the ‘-’ character, but this is not recommended as this character can be used as part of a file name, and hence may cause potential problems.

For example, both commands below would specify the same file within the same filing system.

adfs:$.Documents.Accounts.CashFlow (Preferrred Option)
-adfs-$.Documents.Accounts.CashFlow

Special Fields

Special fields are used to supply additional information to the filing system. For example, NetFS uses them to specify server names or addresses. Special fields are identified by use of the leading ‘#’ character.

net#alan::Disc1.Photos.Sunshine
#alan::Disc1.Photos.Sunshine
-net#alan-:Disc1.Photos.Sunshine
#alan-:Disc1.Photos.Sunshine

Special fields are passed to the filing system as null-terminated strings, with the ‘#’ and trailing ‘:’ or ‘-’ removed (see filing systems above for use of these characters).

Only certain commands can take advantage of special fields. If no special field is specified in a pathname then the appropriate register in the file system routine is set to zero.

The system variable FileSwitch$SpecialField</code is also used to store the special field.

Current Selections

If the filing system is not explicitly stated, then the currently selected one will be used by default. The FileSwitch module is responsible for maintaining a list of file systems and the current selections within each file system. The table below shows the possible selections within each filing system.

# Acronymn CLI char1 Meaning
0 CSD @ Currently Selected Directory
1 PSD \ Previously Selected Directory
2 URD & User Root Directory
3 CSL % Currently Selected Library

1 The character used within the CLI to identify filing system selections.

System Variables

The FileSwitch module provides information relating to filing systems by use of system variables, which as the name suggests are global system-wide variables. Each filing has its own set of system variables, and are case sensitive.

The table below details the system variables available for use.

Variable Meaning
FileSwitch$CurrentFilingSystem Current filing system
FileSwitch$TemporaryFilingSystem Temporary filing system
FileSwitch$fs$CSD CSD for filing system fs
FileSwitch$fs$PSD PSD for filing system fs
FileSwitch$fs$Lib Library for filing system fs
FileSwitch$fs$URD URD for filing system fs
FileSwitch$SpecialField Special field (evaluated as path is processed)
Revised on November 27, 2009 21:18:02 by Alan Robertson (52)? (127.0.0.1)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: FileSwitch Technical Details

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys