ShareFS

Introduction

ShareFS provides a simple mechanism for accessing files on locally networked RISC OS systems. The system uses Freeway to distribute details of the shared discs. This allows any Freeway reachable system (usually those on the local network, but may include any NetI accessible networks), to access the shared files. Although the objects are known as 'shared discs' they may refer to parts of a filing system. Under Select 1, and later, the Filer menu offers the option to share sub-directories.

In the past the SWI calls for ShareFS have been undocumented. They are presented here to fill in this gap, but may be extended and modified without notice. The flags on the SWIs are inconsistent for legacy reasons.

From ShareFS 3.97 onward, the ShareFS Filer can be disabled by setting the ShareFS$Filer variable to 'no'. The filer can be re-enabled by setting it to any other value.

System variables

ShareFS$Filer
Whether the ShareFS Filer is enabled

Controls whether the ShareFS Filer icon is displayed. It can be disabled by setting the ShareFS$Filer variable to 'no'. The filer can be re-enabled by setting it to any other value.

Service calls

Service_SharingService Call &801C8
Change to shared directories
R0=pointer to zero-terminated filing system name ('ShareFS' in our case)
R1=&801C8 (reason code)
R2=Share state: 0 if object is unshared, 1 if object is shared
R3=pointer to zero-terminated directory name being shared
R4=pointer to zero-terminated name of the shared object
R5=private data (filesystem specific)
R0 - R5preserved

This service is issued when a path is shared or unshared by a filing system. It should not be claimed.

SWI calls

ShareFS_CreateShareSWI &47AC0
Share a directory through ShareFS
R0=

Flags:

Bit(s)Meaning
0Share is protected
1Share is read only
2Share is hidden
3Share is a 'sub directory'
4Share is a CD ROM
5Share is authenticated (use R3 as key)
6-31Reserved, must be zero
R1=Pointer to zero-terminated share name
R2=Pointer to zero-terminated directory name
R3=Authentication key number (if bit 5 of the flags is set)
R0 - R3preserved
Interrupts are undefined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant

This SWI is used to share a directory.

ShareFS_StopShareSWI &47AC1
Stop sharing a directory through ShareFS
R0=

Flags (reserved, must be 0)

R1=Pointer to zero-terminated share name, or directory name
R0 - R1preserved
Interrupts are undefined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant

This SWI is used to stop sharing a directory.

ShareFS_EnumerateSharesSWI &47AC2
List the currently shared directories
R0=

Flags:

Bit(s)Meaning
0Share is protected
1Share is read only
2Share is hidden
3Share is a 'sub directory'
4Share is a CD ROM
5-30Reserved, must be zero
31Share is authenticated (use R5 as key)
R4=Opaque value for enumeration, starting from 0
R5=Authentication key number (if bit 5 of the flags is set)
R1=Pointer to zero-terminated disc name
R2=Pointer to zero-terminated directory name
R3=Flags used for the share
R4=New opaque value, or -1 if no more details
Interrupts are undefined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant

This SWI is used to enumerate the shared discs.

ShareFS_IdentifyShareSWI &47AC3
Identify a shared disc
R0=

Flags:

Bit(s)Meaning
0Set:R1 contains share name
Clear:R1 contains directory name
1-31Reserved, must be zero
R1=Pointer to zero-terminated share name or directory name
R2=Pointer to buffer for data
R3=Length of buffer
R0=Flags for share (see SWI ShareFS_CreateShare)
R3=Length of data written to buffer, or -ve length if the name would not fit
Interrupts are undefined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant

This SWI is used to identify a share given its name or directory name.

Wimp messages

Message_FileShareDir&408
Request a dialogue for sharing directories
OffsetContents
20

Flags:

Bit(s)Meaning
0Share is protected (public access attributes are obeyed)
1Share is read only
2Share is hidden (doesn't appear in display)
3Share is authenticated (blank password initially)
4Share is a CD ROM (Read only, with a different icon)
5-29Reserved, must be zero
30Open window at position given
31Reserved, must be zero
24x co-ordinate to open at (if bit 30 set)
28y co-ordinate to open at (if bit 30 set)
32zero-terminated directory name to share
Tasks
ShareFS Filer task
Message must be broadcast (destination 0)

Message must be sent recorded delivery (reason code 18)

This message will cause ShareFS to open a dialogue box showing the share details requests, or the live share details if the directory is already shared.

It should be sent by an application which wishes to present the user with a set of options for sharing a directory. A window will be opened either around the pointer, or at the position requested.