File system operations

Arc has operations to manipulate files and directories. These operations do not all work on non-Unix systems. The I/O operations are closely related to MzScheme's I/O operations.

See I/O in Arc for information on reading and writing files.

ensure-dir path
Creates the specified directory, if it doesn't exist.
>(ensure-dir "newdir")
dir path
Returns the directory contents as a list.
>(dir "mydir")
dir-exists path
Tests if a directory exists.
>(dir-exists "mydir")
file-exists path
Tests if a file exists.
>(file-exists "mydir")
mvfile path
Moves the specified file. New in arc3.
>(mvfile "/tmp/junk" "/tmp/newjunk")
rmfile path
Removes the specified file.
>(rmfile "/tmp/newjunk")
Error: delete-file: cannot delete file
  path: /tmp/newjunk

  system error: No such file or directory; errno=2

rmfile path
Removes the specified file.
>(rmfile "oldfile")

Copyright 2008 Ken Shirriff.