Next Previous Up Top Contents Index

8 The File-System Module

8.3 Manipulating files

The File-System module contains a number of interfaces that let you perform standard file management operations on files already resident on the filesystem. You can rename, copy, or delete any file, and you can set any available properties for the file.

delete-file

Function

delete-file file => ()

Use this function to delete a specified file. If file is actually a link, then the link is deleted, rather than the file it points to.
rename-file

Function

copy-file

Function

rename-file old-file new-file #key if-exists => ()

copy-file old-file new-file #key if-exists => ()

Renames or copies old-file to new-file.
For both functions, if new-file already exists, then the behavior depends on the value of if-exists, which is an instance of <copy/rename-disposition>. The default behavior is to prompt you before overwriting a file.
file-property-setter

Sealed generic function

file-property-setter new-value file key => new-value

Sets a property of file to new-value. The property that is set is specified by the value of key, which must be one of the following:
#"author" #"size" #"creation-date" #"access-date" #"modification-date" #"write-date" #"readable?" #"writeable?" #"executable?"

The type of new-value (and hence the type of the return value of file-property-setter), is determined by the value of key. For example, if key is #"readable?", then new-value should be an instance of <boolean>. For full details, see file-property-setter, page 168.

System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index