W Wrapl, The Programming Language

Libraries Sys.FileSys

Types

MessageT

Base type for error messages sent from file system methods.

DirectoryCreateMessageT

Inherits from:

DirectoryRemoveMessageT

Inherits from:

DirectoryOpenMessageT

Inherits from:

FileRemoveMessageT

Inherits from:

FileRenameMessageT

Inherits from:

FileLinkMessageT

Inherits from:

FileSetPermissionsMessageT

Inherits from:

InfoT

Contains information about files

Constants

Message : Sys.Module.T

.Error: Base type for error messages sent by file system methods.

.DirectoryCreateError: An error occured while creating a directory.

.DirectoryRemoveError: An error occured while removing a directory.

.DirectoryOpenError: An error occured while opening a directory.

.FileRemoveError: An error occured while removing a file.

.FileRenameError: An error occured while renaming a file.

.FileSetPermissionsError: An error occured while setting permissions for a file.

Type : Sys.Module.T

.Block: Block device.

.Char: Char file.

.Fifo: Fifo file.

.Reg: Regular file.

.Dir: Directory.

.Link: Symbolic link.

Functions

BaseName(filename @ Std.String.T)

Returns the base part of filename

Copy(source @ Std.String.T, dest @ Std.String.T)

Copies source to dest.

Not implemented yet.

DirName(filename @ Std.String.T)

Returns the directory part of filename

Exists(filename @ Std.String.T) : Std.String.T

Returns filename if it denotes an existing file/directory. Fails otherwise.

FileInfo(filename @ Std.String.T) : InfoT

Returns an instance of InfoT describing filename if it exists. Fail otherwise.

FileSize(filename @ Std.String.T) : Std.Integer.T

Returns the type of filename if it exists. Fails otherwise.

FileTime(filename @ Std.String.T) : Sys.Time.T

Returns the modification time of filename if it exists. Fails otherwise.

FileType(filename @ Std.String.T) : Std.Integer.T

Returns the type of filename if it exists. Fails otherwise.

Links the file old to new.

ListDir(dir @ Std.String.T) : Std.String.T

Generates the names of the files in dir.

ListDirInfo(dir @ Std.String.T) : InfoT

Generates an instance of InfoT for each file in dir.

MakeDir(path @ Std.String.T, mode @ Std.Integer.SmallT)

Creates a new directory at path with permissions mode.

MakePipe()

Path()

Remove(file @ Std.String.T)

Removes the file file.

RemoveDir(path @ Std.String.T)

Removes the directory path. The directory should be empty.

Rename(old @ Std.String.T, new @ Std.String.T)

Renames the file old to new.

SetPermissions(file @ Std.String.T, perm @ Std.Integer.SmallT)

Sets the permissions for the file file to perm.

Links the file old to new.

TempFile() : Std.String.T

Returns the name of a temporary file.

Methods

:"@"(msg @ MessageT, _ = Std.String.T) : Std.String.T

:modified(info @ InfoT) : Std.Integer.T

Returns the modified time of the file.

:name(info @ InfoT) : Std.String.T

Returns the name of the file.

:size(info @ InfoT) : Std.Integer.T

Returns the size of the file.

:type(info @ InfoT) : Std.Integer.SmallT

Returns a bitmask of the types of the file.