File System Interface

Procedure: file-exists? filename

Returns true iff the file named filename actually exists. This function is defined on arbitrary path values: for URI values we open a URLConnection and invoke getLastModified().

Procedure: file-directory? filename

Returns true iff the file named filename actually exists and is a directory. This function is defined on arbitrary path values; the default implementation for non-file objects is to return #t iff the path string ends with the character ‘/’.

Procedure: file-readable? filename

Returns true iff the file named filename actually exists and can be read from.

Procedure: file-writable? filename

Returns true iff the file named filename actually exists and can be writen to. (Undefined if the filename does not exist, but the file can be created in the directory.)

Procedure: delete-file filename

Delete the file named filename. On failure, throws an exception.

Procedure: rename-file oldname newname

Renames the file named oldname to newname.

Procedure: copy-file oldname newname-from path-to

Copy the file named oldname to newname. The return value is unspecified.

Procedure: create-directory dirname

Create a new directory named dirname. Unspecified what happens on error (such as exiting file with the same name). (Currently returns #f on error, but may change to be more compatible with scsh.)

Procedure: system-tmpdir

Return the name of the default directory for temporary files.

Procedure: make-temporary-file [format]

Return a file with a name that does not match any existing file. Use format (which defaults to "kawa~d.tmp") to generate a unique filename in (system-tmpdir). The implementation is safe from race conditions, and the returned filename will not be reused by this JVM.