Carapace

File & Directory Functions

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


currentDir

Determine the current working directory.

Arguments: none

Return type: String


currentDrive

Determine the current drive letter.

Arguments: none

Return type: String


changeDir

Change to a different working directory.

Arguments:

newDirString

Return type: the empty List ()


changeDrive

Change to a different drive.

Arguments:

newDriveString

Return type: the empty List ()


makeDir

Create a directory.

Arguments:

newDirString

Return type: the empty List ()


removeDir

Remove a directory.

Arguments:

dirString

Return type: the empty List ()


fileStatus

Return information about the status of the file -- the following are legal keys:

sizefile size in bytes
modebit mask of file-mode information
accessTimetime the file was last accessed
modifiedTimetime the file was last modified
ownerIdowner of the file
groupIdgroup of the file
readabletest if the file is readable
writabletest if the file is writable
executabletest if the file is executable
existstest if the file exists

Arguments:

filePathString
keyString

Return type: either Integer or the empty List ()


fileVersion

Return any embeddeded version information for the file.

Arguments:

filePathString

Return type: a List of the following four integers is returned:

major
minor
custom
build


listFiles

List files whos names match the supplied pattern eg.

    (listFiles "*.tmp")

Arguments:

patternString

Return type: List of Strings


listDirectories

List directories whos names match the supplied pattern eg.

    (listDirectories "*")
Note that directories whos names start with a dot . are not listed.

Arguments:

patternString

Return type: List of Strings


rename

Rename a file or a directory.

Arguments:

oldNameString
newNameString

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:

sourceString
destinationString
overwrite (optional)Object

Return type: the empty List ()


removeFile

Remove a file.

Arguments:

filenameString

Return type: the empty List ()


Contents Index Current topic: functions Related topics: objects