[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 File manipulation

Procedures which manipulates the files.

Function: chdir [dir]

Changes the working directory.

Function: directory? path

Returns true if the given path is a directory.

Function: file? path

Returns true if the given path is a valid file.

Function: exist? path

Returns true if the given path exists.

Function: directory-list directory [wildcard-filter-expr]

Gets the files in the given directory. This procedure don’t evaluate recursively. wildcard-filter-expr can be specified as follows.

(and [expr …])selects the paths about which the given propositions are true.
(or [expr …])selects the paths about which at least one of the given propositions is true.
(not expr)selects the paths about which the given condition is false.
existselects the valid paths.
directoryselects the valid directories.
fileselects the valid files.
wildcardselects the paths which matches the given wildcard. The valid metacharacters are shown as follows.
*any characters
.any character
[…]character set
Function: directory-fold path proc seed [wild-card]

apply fold to subdirectories of the given path (which filtered the wildcard). The given procedure needs two arguments. A file name is given as the first argument, and result is given as the second.

Function: make-path-name path file

combinates a path and a file name. This procedure avoids OS Dependencies.

Function: expand-path path

converts the given path to an absolute path.

Function: absolute-path? path

return true if the path is an absolute path.

Function: relative-path? path

return true if the path is a relative path.

Function: file-mtime=? time1 time2

checks the timestamp of time1 is equals to one of time2. File paths, SRFI-19 time objects and seconds from the UNIX epoch are avaliable as arguments.

Function: file-mtime>=? time1 time2

checks timestamp of time1 >= timestamp of time2.

Function: file-mtime>? time1 time2

checks timestamp of time1 > timestamp of time2.

Function: file-mtime<=? time1 time2

checks timestamp of time1 <= timestamp of time2.

Function: file-mtime<? time1 time2

checks timestamp of time1 < timestamp of time2.

Function: mkdir path

creates a directory.

Function: copy-file src-file dest-file

copies src-file to dest-file

Function: move-file src-file dest-file

moves src-file to dest-file

Function: remove-file file …

removes the given files.

Function: rmdir path

removes the given directory.

Function: touch-file file …

sets timestamps of the files to time when applied the procedure.

Function: chmod mode file …

changes privilege of the files. Avail mode are shown as follows, which is like chmod(1).
1. specfication by three characters
The valid characters are shown as follows.
the first character:

ucurrent user
aall users

the second character:

+add privilege which specified by the third character.
-remove privilege privilege which specified by the third.

the third character:

rreadable
wwritable
xexecutable

2. specification by two octal numbers
specifies two numbers. Meaning the number is shown as follows. The first number is applied for current user, and the second is applied for all users. (Though tree numbers are specified as chmod(1), only two numbers are specified as this procedure.)
Bits of the number means as follows.

1privilege for execute
2privilege for writing
4privilege for reading
Function: partition-free-space path
Function: partition-total-space path
Function: partition-usable-space path

gets free space, total space and usable space of the given partition by bytes, respectively.


[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on August 9, 2012 using texi2html 5.0.