File

data File

A file or a directory. Corresponds to java.io.File.

file :: String -> File

Constructs a file from the given path name.

fileExists :: File -> <Proc> Boolean

Returns True if the file or the directory exists.

childFile :: File -> String -> File

childFile parent name constructs a file with the given name in the directory parent.

copyFile :: File -> File -> <Proc> ()

copyFile source target copies source to target, replacing an existing target file.

createFile :: File -> <Proc> ()

Creates a new empty file if a file with the same name does not yet exist.

createTempDirectory :: String -> Maybe File -> <Proc> File

createTempDirectory prefix directory creates a new directory with the given name prefix. If directory is Nothing, the default temporary file directory is used.

createTempFile :: String -> String -> Maybe File -> <Proc> File

createTempFile prefix suffix directory creates a new file with the given name prefix and suffix. If directory is Nothing, the default temporary file directory is used.

cwd :: File -> String

The absolute path name of the file.

deleteFile :: File -> <Proc> ()

Deletes the file, or the directory if it is empty.

deleteFileOnExit :: File -> <Proc> ()

Requests that the file is deleted when the virtual machine terminates.

isDirectory :: File -> <Proc> Boolean

Returns True if the file exists and is a directory.

isFile :: File -> <Proc> Boolean

Returns True if the file exists and is a normal file.

listFiles :: File -> <Proc> Vector File

The files and the directories of the given directory. Empty if the given file is not a directory.

makeDirs :: File -> <Proc> Boolean

Creates the directory, creating also all missing parent directories. Returns True if the directory was created.

moveFile :: File -> File -> <Proc> ()

moveFile source target moves or renames source to target, replacing an existing target file.

parentFile :: File -> String

The path name of the directory containing the file, or null if the file has no parent.

pathOfFile :: File -> String

The path name of the file as it was given when the file was constructed.

pwd :: () -> String

The absolute path name of the current working directory.

sizeOfFile :: File -> <Proc> Long

The size of the file in bytes, or zero if the file does not exist.

syncFile :: File -> <Proc> ()

Forces all system buffers of the given file to be written to the underlying storage.