-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfilesystem.tem
21 lines (21 loc) · 1.09 KB
/
filesystem.tem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(page "File system operations"
(text "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 <a
href='http://download.plt-scheme.org/doc/mzscheme/mzscheme-Z-H-11.html#node_chap_11'>I/O
operations</a>.
<p>See <a href='io.html'>I/O in Arc</a> for information on reading and writing files.")
(newtable ""
(def ensure-dir "path" "Creates the specified directory, if it doesn't exist." (tests (ensure-dir "newdir")))
(op dir "path" "Returns the directory contents as a list."
(tests (dir "mydir")))
(op predicate dir-exists "path" "Tests if a directory exists."
(tests (dir-exists "mydir")))
(op predicate file-exists "path" "Tests if a file exists."
(tests (file-exists "mydir")))
(op mvfile "path" "Moves the specified file. New in arc3."
(faketest "(mvfile \"/tmp/junk\" \"/tmp/newjunk\")" "nil"))
(op rmfile "path" "Removes the specified file."
(tests (rmfile "/tmp/newjunk")))
(op rmfile "path" "Removes the specified file."
(faketest "(rmfile \"oldfile\")" "nil"))
)
)