chibi-scheme/lib/chibi/filesystem.sld
Alex Shinn 8b5eb68238 File descriptors maintain a reference count of ports open on them
They can be close()d explicitly with close-file-descriptor, and
will close() on gc, but only explicitly closing the last port on
them will close the fileno.  Notably needed for network sockets
where we open separate input and output ports on the same socket.
2014-02-20 22:32:50 +09:00

38 lines
1.7 KiB
Scheme

;;> Interface to the filesystem and file descriptor objects.
;;> Note that file descriptors are currently represented as
;;> integers, but may be replaced with opaque (and gc-managed)
;;> objects in a future release.
(define-library (chibi filesystem)
(export duplicate-file-descriptor duplicate-file-descriptor-to
close-file-descriptor renumber-file-descriptor
open-input-file-descriptor open-output-file-descriptor
delete-file link-file symbolic-link-file rename-file
directory-files directory-fold directory-fold-tree
delete-file-hierarchy delete-directory
create-directory create-directory*
current-directory change-directory with-directory
open open-pipe make-fifo
file-status
file-device file-inode
file-mode file-num-links
file-owner file-group
file-represented-device file-size
file-block-size file-num-blocks
file-access-time file-modification-time file-change-time
file-regular? file-directory? file-character?
file-block? file-fifo? file-link?
file-socket? file-exists?
get-file-descriptor-flags set-file-descriptor-flags!
get-file-descriptor-status set-file-descriptor-status!
open/read open/write open/read-write
open/create open/exclusive open/truncate
open/append open/non-block
file-lock
lock/shared lock/exclusive lock/non-blocking lock/unlock
is-a-tty?)
(import (chibi) (chibi string))
(include-shared "filesystem")
(include "filesystem.scm"))