Operations
SetUser:
PROC [h: UnixServerHandle, name:
ROPE, password:
ROPE] ~
INLINE { h.procs.setUser[h.sH, name, password] };
Set user name and password associated with the server handle. NIL means name/password of logged-in Cedar user.
Raises Error[$badCredentials] if password is incorrect.
SetUserProc: TYPE ~ PROC [sH: ServerHandle, name, password: ROPE];
Open:
PROC [h: UnixServerHandle, path:
ROPE]
RETURNS [fD: FileDescriptor] ~
INLINE {
RETURN [h.procs.open[h.sH, path]] };
Open an existing file.
OpenProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE] RETURNS [fD: FileDescriptor];
Close:
PROC [h: UnixServerHandle, fD: FileDescriptor] ~
INLINE { h.procs.close[h.sH, fD] };
Close the designated file.
CloseProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor];
Create:
PROC [h: UnixServerHandle, path:
ROPE, mode: Mode]
RETURNS [fD: FileDescriptor] ~
INLINE {
RETURN [h.procs.create[h.sH, path, mode]] };
Create an empty file of the given name, smashing any existing one. The mode is the protection mode assigned to the new file.
CreateProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE, mode: Mode] RETURNS [fD: FileDescriptor];
Delete:
PROC [h: UnixServerHandle, path:
ROPE] ~
INLINE { h.procs.delete[h.sH, path] };
Delete the named file.
DeleteProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE];
MkDir:
PROC [h: UnixServerHandle, path:
ROPE, mode: Mode] ~
INLINE { h.procs.mkDir[h.sH, path, mode] };
Create a directory.
MkDirProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE, mode: Mode];
RmDir:
PROC [h: UnixServerHandle, path:
ROPE] ~
INLINE { h.procs.rmDir[h.sH, path] };
Remove an empty directory.
RmDirProc: TYPE ~ PROC [sH: ServerHandle, path: ROPE];
Link:
PROC [h: UnixServerHandle, toPath, asPath:
ROPE] ~
INLINE { h.procs.link[h.sH, toPath, asPath] };
Create a hard link to file toPath under the name asPath. Since the link is hard, toPath must designate an existing file on the same file system volume as asPath.
LinkProc: TYPE ~ PROC [sH: ServerHandle, toPath, asPath: ROPE];
SymLink:
PROC [h: UnixServerHandle, toPath, asPath:
ROPE] ~
INLINE { h.procs.symLink[h.sH, toPath, asPath] };
Create a Symbolic link to file toPath under the name asPath. No check to see whether the file exists.
SymLinkProc: TYPE ~ PROC [sH: ServerHandle, toPath, asPath: ROPE];
Rename:
PROC [h: UnixServerHandle, fromPath, toPath:
ROPE] ~
INLINE { h.procs.rename[h.sH, fromPath, toPath] };
Rename atomically. The fromPath and toPath must be on the same file system volume.
RenameProc: TYPE ~ PROC [sH: ServerHandle, fromPath, toPath: ROPE];
EachNameProc: TYPE ~ PROC [name: ROPE] RETURNS [continue: BOOL ← TRUE];
Enumerate:
PROC [h: UnixServerHandle, dirPath:
ROPE, pattern:
ROPE, eachName: EachNameProc] ~
INLINE { h.procs.enumerate[h.sH, dirPath, pattern, eachName] };
Enumerate files in directory designated by dirPath with names matching pattern.
EnumerateProc: TYPE ~ PROC [sH: ServerHandle, dirPath: ROPE, pattern: ROPE, eachName: EachNameProc];
GetInfo:
PROC [h: UnixServerHandle, fD: FileDescriptor]
RETURNS [type: FType, size:
CARD, mode: Mode, mTime:
GMT] ~
INLINE {
[type, size, mode, mTime] ← h.procs.getInfo[h.sH, fD] };
Lookup information on given file.
GetInfoProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor]
RETURNS [type: FType, size: CARD, mode: Mode, mTime: GMT];
SetInfo:
PROC [h: UnixServerHandle, fD: FileDescriptor, mode: Mode, mTime:
GMT] ~
INLINE { h.procs.setInfo[h.sH, fD, mode, mTime] };
Set (selected) information about given file. If mode is CARDINAL.LAST it will not be changed. If mTime is BasicTime.nullGMT it will not be changed.
SetInfoProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor, mode: Mode, mTime: GMT];
Read:
PROC [h: UnixServerHandle, fD: FileDescriptor, offset, count:
CARD, bOffset:
CARD, block:
REF
TEXT]
RETURNS [bytesRead:
CARD] ~
INLINE { bytesRead ← h.procs.read[h.sH, fD, offset, count, bOffset, block] };
Read specified bytes of file into block. Return number of bytes read, update block.length.
ReadProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor, offset, count: CARD, bOffset: CARD, block: REF TEXT] RETURNS [bytesRead: CARD];
Write:
PROC [h: UnixServerHandle, fD: FileDescriptor, offset, count:
CARD, bOffset:
CARD, block:
REF
TEXT]
RETURNS [bytesWritten:
CARD] ~
INLINE { bytesWritten ← h.procs.write[h.sH, fD, offset, count, bOffset, block] };
Write specified bytes of file from block. Return number of bytes written.
WriteProc: TYPE ~ PROC [sH: ServerHandle, fD: FileDescriptor, offset, count: CARD, bOffset: CARD, block: REF TEXT] RETURNS [bytesWritten: CARD];
}...