Carapace contains the following file-system functions:
| function name | description |
|---|---|
| currentDir | determine the current working directory |
| currentDrive | determine the current drive letter |
| changeDir | change to a different working directory |
| changeDrive | change to a different drive |
| makeDir | create a directory |
| removeDir | remove a directory |
| fileStatus | return information about the status of the file |
| fileVersion | return any embeddeded version information for the file |
| listFiles | list files whos names match the supplied pattern |
| listDirectories | list directories whos names match the supplied pattern |
| rename | rename a file or a directory |
| copyFile | copy a file |
| removeFile | remove a file |
currentDirDetermine the current working directory.
Arguments: none
Return type: String
currentDriveDetermine the current drive letter.
Arguments: none
Return type: String
changeDirChange to a different working directory.
Arguments:
| newDir | String |
Return type: the empty List ()
changeDriveChange to a different drive.
Arguments:
| newDrive | String |
Return type: the empty List ()
makeDirCreate a directory.
Arguments:
| newDir | String |
Return type: the empty List ()
removeDirRemove a directory.
Arguments:
| dir | String |
Return type: the empty List ()
fileStatusReturn information about the status of the file -- the following are legal keys:
size | file size in bytes |
mode | bit mask of file-mode information |
accessTime | time the file was last accessed |
modifiedTime | time the file was last modified |
ownerId | owner of the file |
groupId | group of the file |
readable | test if the file is readable |
writable | test if the file is writable |
executable | test if the file is executable |
exists | test if the file exists |
Arguments:
| filePath | String |
| key | String |
Return type: either Integer or
the empty List ()
fileVersionReturn any embeddeded version information for the file.
Arguments:
| filePath | String |
Return type: a List of the following four
integers is returned:
major |
minor |
custom |
build |
listFilesList files whos names match the supplied pattern eg.
(listFiles "*.tmp")
Arguments:
| pattern | String |
listDirectoriesList directories whos names match the supplied pattern eg.
(listDirectories "*")
Note that directories whos names start with a dot . are not listed.
Arguments:
| pattern | String |
renameRename a file or a directory.
Arguments:
| oldName | String |
| newName | String |
Return type: the empty List ()
copyFile
Copy a file. If the third argument is supplied and is () then
the destination file is not overwritten if it already exists. The default is
to overwrite files.
Arguments:
| source | String |
| destination | String |
| overwrite (optional) | Object |
Return type: the empty List ()
removeFileRemove a file.
Arguments:
| filename | String |
Return type: the empty List ()
| Contents | Index | Current topic: functions | Related topics: objects |