Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
File system Source Code
 previous   up   next 

Types
fileType
Type to describe the type of a file.
filePermission
Type to describe one file permission.
fileMode
Type to describe the mode (all permissions) of a file.
fileSys
Interface type for file systems (os, tar, zip, jar, ftp, ...).
emptyFileSys
Describes an empty file system.

fileType

const type: fileType

Type to describe the type of a file. Possible values are FILE_ABSENT, FILE_UNKNOWN, FILE_REGULAR, FILE_DIR, FILE_CHAR, FILE_BLOCK, FILE_FIFO, FILE_SYMLINK and FILE_SOCKET. The value FILE_ABSENT is used to describe a nonexistent file.


filePermission

const type: filePermission

Type to describe one file permission. Possible values are EXEC_OTHER, WRITE_OTHER, READ_OTHER, EXEC_GROUP, WRITE_GROUP, READ_GROUP, EXEC_USER and WRITE_USER and READ_USER.


fileMode

const type: fileMode

Type to describe the mode (all permissions) of a file. A fileMode is a set of filePermission. A test for a permission is a set mempership test. E.g.:

EXEC_USER in aFileMode

fileSys

const type: fileSys

Interface type for file systems (os, tar, zip, jar, ftp, ...).


emptyFileSys

const type: emptyFileSys

Describes an empty file system.


Function Summary
void
close (inout fileSys: fileSystem)
Close a file system.
array string
readDir (inout fileSys: fileSystem, in string: dirPath)
Determine the filenames in a directory of a file system.
array string
readDir (inout fileSys: fileSystem, in string: dirPath, RECURSIVE)
Paths of files in a directory and its subdirectories inside a file system.
array string
readDir (inout fileSys: fileSystem)
Determine the file names in the top directory of a file system.
array string
readDir (inout fileSys: fileSystem, RECURSIVE)
Determine all file paths in a file system.
fileType
fileType (inout fileSys: fileSystem, in string: filePath)
Determine the type of a file.
fileType
fileTypeSL (inout fileSys: fileSystem, in string: filePath)
Determine the type of a file.
fileMode
fileMode (inout fileSys: fileSystem, in string: filePath)
Determine the file mode (permissions) of a file.
void
setFileMode (inout fileSys: fileSystem, in string: filePath, in fileMode: mode)
Change the file mode (permissions) of a file.
integer
fileSize (inout fileSys: fileSystem, in string: filePath)
Determine the file size of a file.
bigInteger
bigFileSize (inout fileSys: fileSystem, in string: filePath)
Determine the file size of a file.
time
getMTime (inout fileSys: fileSystem, in string: filePath)
Determine the modification time of a file.
void
setMTime (inout fileSys: fileSystem, in string: filePath, in time: modificationTime)
Set the modification time of a file in a TAR archive.
file
open (inout fileSys: fileSystem, in string: filePath, in string: mode)
Open a file with filePath and mode in the file system.
string
getFile (inout fileSys: fileSystem, in string: filePath)
Get the contents of file filePath in the file system.
void
putFile (inout fileSys: fileSystem, in string: filePath, in string: stri)
Write stri to the file filePath using the file system.
string
readlink (inout fileSys: fileSystem, in string: filePath)
Reads the destination of a symbolic link.
void
removeFile (inout fileSys: fileSystem, in string: filePath)
Remove a file (except nonempty directories), from a file system.
void
removeTree (inout fileSys: fileSystem, in string: filePath)
Remove a file of any type inclusive a directory tree, from a file system.
void
moveFile (inout fileSys: fileSystem, in string: sourcePath, in string: destPath)
Move and rename a file or directory tree in a file system.
void
mkdir (inout fileSys: fileSystem, in string: dirPath)
Creates a directory on a remote host using the file system.
void
rmdir (inout fileSys: fileSystem, in string: dirPath)
Deletes an empty directory using the file system.
string
getcwd (inout fileSys: fileSystem)
Determine the current working directory of the file system.
void
chdir (inout fileSys: fileSystem, in string: dirPath)
Change the current working directory of the file system.
array string
readDir (inout emptyFileSys: fileSystem, in var string: dirPath, RECURSIVE)
Paths of files in a directory and its subdirectories inside a file system.
bigInteger
bigFileSize (inout emptyFileSys: fileSystem, in string: filePath)
Determine the file size of a file.

Function Detail

close

const proc: close (inout fileSys: fileSystem)

Close a file system.


readDir

const func array string: readDir (inout fileSys: fileSystem, in string: dirPath)

Determine the filenames in a directory of a file system. Note that the function returns only the file names. Additional information must be obtained with other calls.

Parameters:
fileSystem - File system in which the directory is searched for.
dirPath - Path of a directory in the file system.
Returns:
an array with the file names.

readDir

const func array string: readDir (inout fileSys: fileSystem, in string: dirPath, RECURSIVE)

Paths of files in a directory and its subdirectories inside a file system. The function returns the file paths relative to the given directory.

Parameters:
fileSystem - File system in which the directory is searched for.
dirPath - Path of a directory in the file system.
Returns:
an array with the file paths.

readDir

const func array string: readDir (inout fileSys: fileSystem)

Determine the file names in the top directory of a file system.

Returns:
an array with the file names.

readDir

const func array string: readDir (inout fileSys: fileSystem, RECURSIVE)

Determine all file paths in a file system.

Returns:
an array with the file paths.

fileType

const func fileType: fileType (inout fileSys: fileSystem, in string: filePath)

Determine the type of a file. The function does follow symbolic links. Therefore it never returns FILE_SYMLINK. A return value of FILE_ABSENT does not imply that a file with this name can be created, since missing directories and illegal file names cause also FILE_ABSENT.

Returns:
the type of the file.

fileTypeSL

const func fileType: fileTypeSL (inout fileSys: fileSystem, in string: filePath)

Determine the type of a file. The function does not follow symbolic links. Therefore it may return FILE_SYMLINK. A return value of FILE_ABSENT does not imply that a file with this name can be created, since missing directories and illegal file names cause also FILE_ABSENT.

Returns:
the type of the file.

fileMode

const func fileMode: fileMode (inout fileSys: fileSystem, in string: filePath)

Determine the file mode (permissions) of a file.

Returns:
the file mode.

setFileMode

const proc: setFileMode (inout fileSys: fileSystem, in string: filePath, in fileMode: mode)

Change the file mode (permissions) of a file. Not all file systems support this function.


fileSize

const func integer: fileSize (inout fileSys: fileSystem, in string: filePath)

Determine the file size of a file. The file size is measured in bytes. For directories a size of 0 is returned.

Returns:
the size of the file.

bigFileSize

const func bigInteger: bigFileSize (inout fileSys: fileSystem, in string: filePath)

Determine the file size of a file. The file size is measured in bytes. For directories a size of 0 is returned.

Returns:
the size of the file.

getMTime

const func time: getMTime (inout fileSys: fileSystem, in string: filePath)

Determine the modification time of a file.

Returns:
the modification time of the file.

setMTime

const proc: setMTime (inout fileSys: fileSystem, in string: filePath, in time: modificationTime)

Set the modification time of a file in a TAR archive.


open

const func file: open (inout fileSys: fileSystem, in string: filePath, in string: mode)

Open a file with filePath and mode in the file system.


getFile

const func string: getFile (inout fileSys: fileSystem, in string: filePath)

Get the contents of file filePath in the file system.

Returns:
the specified file as string.

putFile

const proc: putFile (inout fileSys: fileSystem, in string: filePath, in string: stri)

Write stri to the file filePath using the file system. If the file exists already, it is overwritten. Not all file systems support this function.


readlink

const func string: readlink (inout fileSys: fileSystem, in string: filePath)

Reads the destination of a symbolic link. Not all file systems support this function.

Returns:
The destination refered by the symbolic link.

removeFile

const proc: removeFile (inout fileSys: fileSystem, in string: filePath)

Remove a file (except nonempty directories), from a file system. Not all file systems support this function.


removeTree

const proc: removeTree (inout fileSys: fileSystem, in string: filePath)

Remove a file of any type inclusive a directory tree, from a file system. Not all file systems support this function.


moveFile

const proc: moveFile (inout fileSys: fileSystem, in string: sourcePath, in string: destPath)

Move and rename a file or directory tree in a file system. Not all file systems support this function.


mkdir

const proc: mkdir (inout fileSys: fileSystem, in string: dirPath)

Creates a directory on a remote host using the file system. Not all file systems support this function.


rmdir

const proc: rmdir (inout fileSys: fileSystem, in string: dirPath)

Deletes an empty directory using the file system. Not all file systems support this function.


getcwd

const func string: getcwd (inout fileSys: fileSystem)

Determine the current working directory of the file system. Not all file systems support this function.

Returns:
the current working directory as absolute path.

chdir

const proc: chdir (inout fileSys: fileSystem, in string: dirPath)

Change the current working directory of the file system. Not all file systems support this function.


readDir

const func array string: readDir (inout emptyFileSys: fileSystem, in var string: dirPath, RECURSIVE)

Paths of files in a directory and its subdirectories inside a file system. The function returns the file paths relative to the given directory.

Parameters:
fileSystem - File system in which the directory is searched for.
dirPath - Path of a directory in the file system.
Returns:
an array with the file paths.
Raises:
RANGE_ERROR - dirPath does not use the standard path representation.
FILE_ERROR - dirPath is not present in the file system.

bigFileSize

const func bigInteger: bigFileSize (inout emptyFileSys: fileSystem, in string: filePath)

Determine the file size of a file. The file size is measured in bytes. For directories a size of 0 is returned.

Returns:
the size of the file.


 previous   up   next