Next: , Previous: , Up: System Interface   [Contents][Index]


7.6.1 Directories

(require 'directory)

Function: current-directory

current-directory returns a string containing the absolute file name representing the current working directory. If this string cannot be obtained, #f is returned.

If current-directory cannot be supported by the platform, then #f is returned.

Function: make-directory name

Creates a sub-directory name of the current-directory. If successful, make-directory returns #t; otherwise #f.

Function: directory-for-each proc directory

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.

Function: directory-for-each proc directory pred

Applies proc only to those filenames for which the procedure pred returns a non-false value.

Function: directory-for-each proc directory match

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")
-|
"Bev2slib.scm"
"Template.scm"
Function: directory*-for-each proc path-glob

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.