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

Page "Software information: HForm" does not exist. Please create it now, or hit the "back" button in your browser.

FileSwitch Use Of File Types

Programmer's Reference Manuals
» Part 4 – Using Filing Systems
» FileSwitch
» Technical Details
» Use of File Types

Use of File Types

Determine the Action to Perform

As discussed in the key features section on FileSwitch, a 3-digit hexadecimal value is used to represent the file type. It is the file type that determines the action that must be performed on a file.

When a date stamped file of type xxx has an action of *Load or *Run performed on it, FileSwitch carries out several steps to determine what it should actually do.

The steps are:

  1. Look for the system variables Alias$@LoadType_xxx or Alias$@RunType_xxx respectively.
  2. If variable of string or macro type exists, then it is copied (after macro extension), and the full pathname is used to find the file on either File$Path or Run$Path
  3. Any parameters passed are also appended for *Run commands
  4. The whole string is passed to the command Line interpreter using OS_CLI

An Example of using LoadType

File Details
CSD adfs::HardDisc.$.Photos.Wedding
Command *LOAD Photo001
File type &FF9, Sprite (bitmap)
Step 1 – Find system variables
Variable *@LoadType_FF9
Step 2&3 – Use full pathname + parameters
Issues command *@LoadType_FF9 adfs::HardDisc.$.Photos.Wedding.Photo001
Alias$@LoadType_FF9 has a value of SLoad %*0 by default
Step 4 – CLI issues command
Output *SLoad adfs::HardDisc.$.Photos.Wedding.Photo001

An Example of using RunType

File Details
CSD adfs::HardDisc.$.Programs
Command *RUN BasicProg p1 p2
File type &FFB, BASIC
Step 1 – Find system variables
Variable *@RunType_FFB
Step 2&3 – Use full pathname + parameters
Issues command *@RunType_FFB adfs::HardDisc.$.Programs.BasicProg p1 p2
Alias$@RunType_FFB has a value of Basic –quit “%0 %*1 by default
Step 4 – CLI issues command
Output *Basic - quit "adfs::HardDisc.$.Programs.BasicProg" p1 p2

Default Settings

The filing system manager sets several of these system variables by default; however, they can be changed easily. This is useful say, if a newly installed application wants to be responsible for loading files of a certain type.

Setting a file of a specific file type can easily be achieved by using the *Set command.

A simple example of this is command is provided below.

Set Alias$@LoadType_007 SpyApp %*0
Set Alias$@RunType_007 SpyApp %*0

Revised on December 29, 2010 21:32:05 by Trevor Johnson (329)? (127.0.0.1)
Edit | Back in time (2 revisions) | 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