RFILSYS(4)
NAME
rfilsys − remote file system pseudo-device driver (types rfm, rf)
SYNOPSIS
#include <rfile.h>
#include <fserver.h>
read(device buffer, length)
write(device, buffer, length)
open(device, name, mode)
close(device)
control(device, function, arg1, arg2)
init(device)
seek(device,offset)
DESCRIPTION
The rfm and rf pseudo-device drivers work as a pair to provide access to remote files using a Xinu remote file server across an Internet. There is one master remote file pseudo-device (type rfm) for a given remote server. When users open the master remote file pseudo-device, they pass it the name of a specific file and the access mode for that file. The call to OPEN(2) returns the device descriptor of a remote file pseudo-device (type rf) connected to the named file.
Once opened, a user calls READ(2), WRITE(2), GETC(2), or PUTC(2), to transfer data between the user program and the remote file; they call SEEK(2) to position the file pointer. The user calls CLOSE(2) to disconnect from the file. Finally, users call CONTROL(2) on the master pseudo-device to test file access protections, remove files, or change file names.
The standard Xinu device name for the remote file master pseudo-device is RFILSYS; the standard Xinu device name for individual remote file pseudo-devices is RFILE. The operations on these devices are defined by:
open(device, name, mode)
Opens a connection to a remote file given the file name and access mode, and returns the device descriptor used to access the file. See ACCESS(2) for valid file modes.
read(device buffer, length)
Transfers up to length bytes of data from a file to the user’s buffer, and returns the number of bytes found or EOF if no more data remains in the file.
write(device, buffer, length)
Writes length bytes of data to a file from the user’s buffer. File length extends automatically if needed.
close(device)
Disconnect from a file, leaving it on secondary storage.
control(device, function, arg1, arg2)
Handles file manipulation other than data transfer. The possible functions are:
FLACCESS − test access (arg1 is mode string).
FLREMOVE − remove file named by arg1.
FLRENAME − rename file named by arg1 to arg2
FLCLEAR − clear the remote file datagram port
init(device)
When called with an rf device, initializes the pseudo-device data structures at system startup. Initializing the master pseudo-device has no effect.
seek(device,offset)
Positions the file to offset bytes from the beginning.
December 01, 1986 — Xinu Programmer’s Manual