Next: Posix Extensions, Previous: Records, Up: Packages [Contents][Index]
If 'i/o-extensions
is provided (by linking in ioext.o),
Line I/O in SLIB, and the following functions are defined:
Returns a vector of integers describing the argument. The argument
can be either a string or an open input port. If the argument is an
open port then the returned vector describes the file to which the
port is opened; If the argument is a string then the returned vector
describes the file named by that string. If there exists no file with
the name string, or if the file cannot be accessed #f
is returned.
The elements of the returned vector are as follows:
ID of device containing a directory entry for this file
Inode number
File type, attributes, and access control summary
Number of links
User ID of file owner
Group ID of file group
Device ID; this entry defined only for char or blk spec files
File size (bytes)
Time of last access
Last modification time
Last file status change time
Returns the process ID of the current process.
If the file with name name already exists, return #f
,
otherwise try to create and open the file like try-open-file
,
See Files and Ports. If the optional integer argument perms is
provided, it is used as the permissions of the new file (modified by
the current umask).
Closes port port and reopens it with filename and
modes. reopen-file
returns #t
if successful,
#f
if not.
Creates and returns a duplicate port from port. Duplicate unbuffered ports share one file position. modes are as for open-file.
Closes to-port and makes to-port be a duplicate of
from-port. redirect-port!
returns to-port if
successful, #f
if not. If unsuccessful, to-port is not
closed.
Returns a directory object corresponding to the file system
directory named dirname. If unsuccessful, returns #f
.
Returns the string name of the next entry from the directory dir.
If there are no more entries in the directory, readdir
returns a
#f
.
Reinitializes dir so that the next call to readdir
with
dir will return the first entry in the directory again.
Closes dir and returns #t
. If dir is already
closed,, closedir
returns a #f
.
proc must be a procedure taking one argument. ‘Directory-For-Each’ applies proc to the (string) name of each file in directory. The dynamic order in which proc is applied to the filenames is unspecified. The value returned by ‘directory-for-each’ is unspecified.
Applies proc only to those filenames for which the procedure pred returns a non-false value.
Applies proc only to those filenames for which
(filename:match?? match)
would return a non-false value
(see Filenames in SLIB).
(require 'directory) (directory-for-each print "." "[A-Z]*.scm") -| "Init.scm" "Iedline.scm" "Link.scm" "Macro.scm" "Transcen.scm" "Init5f4.scm"
path-glob is a pathname whose last component is a (wildcard) pattern (see Filenames in SLIB). proc must be a procedure taking one argument. ‘directory*-for-each’ applies proc to the (string) name of each file in the current directory. The dynamic order in which proc is applied to the filenames is unspecified. The value returned by ‘directory*-for-each’ is unspecified.
The mkdir
function creates a new, empty directory whose name is
path. The integer argument mode specifies the file
permissions for the new directory.
See The Mode Bits for Access Permission in Gnu C Library,
for more information about this.
mkdir
returns if successful, #f
if not.
The rmdir
function deletes the directory path. The
directory must be empty before it can be removed. rmdir
returns
if successful, #f
if not.
Changes the current directory to filename. If filename does not
exist or is not a directory, #f
is returned. Otherwise, #t
is
returned.
The function getcwd
returns a string containing the absolute file
name representing the current working directory. If this string cannot
be obtained, #f
is returned.
Renames the file specified by oldfilename to newfilename.
If the renaming is successful, #t
is returned. Otherwise,
#f
is returned.
Copies the file specified by oldfilename to newfilename.
If the copying is successful, #t
is returned. Otherwise,
#f
is returned.
The function chmod
sets the access permission bits for the file
named by file to mode. The file argument may be a
string containing the filename or a port open to the file.
chmod
returns if successful, #f
if not.
Sets the file times associated with the file named pathname to
have access time acctime and modification time modtime.
utime
returns if successful, #f
if not.
The function umask
sets the file creation mask of the current
process to mask, and returns the previous value of the file
creation mask.
Returns the integer file descriptor associated with the port port.
If an error is detected, #f
is returned.
Returns #t
if the file named by pathname can be accessed in
the way specified by the how argument. The how argument can
be the logior
of the flags:
Or the how argument can be a string of 0 to 3 of the following
characters in any order. The test performed is the and
of the
associated tests and file-exists?
.
File-is-executable?
File-is-writable?
File-is-readable?
Transfers control to program command called with arguments
arg0 …. For execl
, command must be an exact
pathname of an executable file. execlp
searches for
command in the list of directories specified by the environment
variable PATH. The convention is that arg0 is the same name
as command.
If successful, this procedure does not return. Otherwise an error
message is printed and the integer errno
is returned.
Like execl
and execlp
except that the set of arguments to
command is arglist.
adds or removes definitions from the environment. If the string is of the form ‘NAME=VALUE’, the definition is added to the environment. Otherwise, the string is interpreted as the name of an environment variable, and any definition for this variable in the environment is removed.
Names of environment variables are case-sensitive and must not contain
the character =
. System-defined environment variables are
invariably uppercase.
Putenv
is used to set up the environment before calls to
execl
, execlp
, execv
, execvp
, system
,
or open-pipe
(see open-pipe).
To access environment variables, use getenv
(see getenv in SLIB).
Next: Posix Extensions, Previous: Records, Up: Packages [Contents][Index]