There are two implementations of this SRFI, Scsh version 0.7,
which can be found at GitHub in the scsh repository of scheme,
and a Chibi Scheme (srfi 170) library. You can find the Chibi Scheme example implementation,
and build notes for scsh, in their own srfi subdirectories.
This file documents the numerous exceptions and deviations of scsh 0.7 considered as an implementation of this SRFI.
Scsh exposes errno-error
and uses specialized syntax to catch system errors.
Scsh does not distinguish between textual and binary ports,
so there are two procedures to convert file descriptors to ports,
fdes->inport and fdes->outport.
Textual and binary ports are the same, and there is no support
for buffering or for binary input/output ports.
The create-directory, create-fifo,
and set-file-mode procedures were changed in scsh 0.7 to take
a file-mode record instead of traditional permission bits. A work-around
is to manually set the mode of a file, and use
file-info and file-info:mode to get a record
with the desired permission bits.
When scsh create-hard-link is asked to make a link across file systems,
rather than erroring it creates a copy of the file at newname.
access-time and mod-time are rational numbers,
which are coerced to exact integers, and treated as the number of elapsed seconds
since the POSIX epoch of midnight January 1, 1970.
The follow? flag for scsh's file-info is optional.
file-info mode record field is masked to only return the nine low-order permission bits,
omitting the bits for set-user-ID, set-group-ID, and the save text
or "sticky" bit.
The scsh file-info record fields atime, mtime, and ctime
fields are exact integers instead of time objects, and are the number of elapsed seconds
(excluding leap seconds) since the POSIX epoch of midnight January 1, 1970.
It does not implement the rdev, blksize, and blocks fields.
Scsh does not have make-directory-files-generator, but it is easy to implement with
open-directory, read-directory, and close-directory.
See the Chibi Scheme implementation for an example.
The scsh open-directory, read-directory, and close-directory
procedures are called open-directory-stream etc. The read-directory-stream
functions returns #f at the end of the directory instead of
an end of file object.
Scsh does not support the real-path procedure.
Scsh does not support parameters, so temp-file-prefix does not exist.
Instead, there is a fluid variable named *temp-file-template* whose
value is as defined in this SRFI with /var added in front of /tmp,
and "~a" appended to it, for example, /var/tmp/6812~a.
In scsh call-with-temporary-filename is implemented with
temp-file-iterate, with the following difference:
The scsh fluid variable *temp-file-template* described above
includes the substring "~a", which is required in the optional
prefix argument to temp-file-iterate (the
varying strings it iterates through are inserted there with format,
instead of being concatenated with prefix as in
call-with-temporary-filename).
If trying the "To rename a file to a temporary name" example,
beware of the cross file system create-hard-link bug
mentioned above.
In scsh the procedures current-directory and
set-current-directory! are called
cwd and chdir respectively.
Scsh specifies but does not implement nice.
Scsh does not provide posix-time, but it is easily defined using the procedures
time+ticks and ticks/sec. The first procedure returns two values, the Posix
second and the subsecond time in ticks; the second procedure specifies how many ticks
a second contains. These are easily converted to seconds and nanoseconds
and from there to a SRFI 19 time object.
Scsh's set-environment-variable! is named setenv, and does not signal an error in
any way if it fails. It does not implement any equivalent to delete-environment-variable!
Scsh's terminal? is named tty?.