ShareFS


Contents


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
Use

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.

Related APIs
None

Service calls


Service_Sharing
(Service &801C8)

Change to shared directories
On entry
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)
On exit
R0-5preserved
Use

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

Related SWIs
ShareFS_CreateShare, ShareFS_StopShare

SWI calls


ShareFS_CreateShare
(SWI &47AC0)

Share a directory through ShareFS
On entry
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)
On exit
R0-3preserved
Interrupts
Interrupts are undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant
Use

This SWI is used to share a directory.

Related SWIs
ShareFS_StopShare
Related messages
Message_FileShareDir

ShareFS_StopShare
(SWI &47AC1)

Stop sharing a directory through ShareFS
On entry
R0=

Flags (reserved, must be 0)

R1=Pointer to zero-terminated share name, or directory name
On exit
R0-1preserved
Interrupts
Interrupts are undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant
Use

This SWI is used to stop sharing a directory.

Related SWIs
ShareFS_CreateShare
Related messages
Message_FileShareDir

ShareFS_EnumerateShares
(SWI &47AC2)

List the currently shared directories
On entry
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)
On exit
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
Interrupts are undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant
Use

This SWI is used to enumerate the shared discs.

Related SWIs
ShareFS_CreateShare, ShareFS_IdentifyShare

ShareFS_IdentifyShare
(SWI &47AC3)

Identify a shared disc
On entry
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
On exit
R0=Flags for share (see ShareFS_CreateShare)
R3=Length of data written to buffer, or -ve length if the name would not fit
Interrupts
Interrupts are undefined
Fast interrupts are enabled
Processor mode
Processor is in SVC mode
Re-entrancy
SWI is not re-entrant
Use

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

Related SWIs
ShareFS_CreateShare, ShareFS_EnumerateShares

Wimp messages


Message_FileShareDir
(&408)

Request a dialogue for sharing directories
Message
OffsetContents
R1+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

R1+24x co-ordinate to open at (if bit 30 set)
R1+28y co-ordinate to open at (if bit 30 set)
R1+32zero-terminated directory name to share
Source
Tasks
Destination
ShareFS Filer task
Delivery
Message must be broadcast (destination 0)
Message must be sent recorded delivery (reason code 18)
Use

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.

Related SWIs
ShareFS_CreateShare
Related messages
Message_FileShareDir

Document information

Maintainer(s):
History:
RevisionDateAuthorChanges
12006GerphInitial version
  • Released as RISC OS Select documentation.
228 Dec 2021GerphPRM-in-XML conversion
  • Created from original documentation for RISC OS Select.
Related:http://www.riscos.com/support/developers/riscos6/networking/sharefs.html
Disclaimer:

© Gerph, 2021.