Libraries |
|
Ar | Source Code |
|
|
arArchive
const type: arArchive
-
FileSys implementation type to access an AR archive. File paths in an AR archive can be absolute (they start with a slash) or relative (they do not start with a slash). The ar file system does not support the concept of a current working directory. The functions chdir and getcwd are not supported by the ar file system. Absolute and relative paths in an AR archive can be accessed directly. Since "/" is just a normal path in an AR archive the root path of a ar file system is "". Possible usages of ar file system functions are:
getMTime(anArArchive, "src/drivers") # Relative path in the archive. fileType(anArArchive, "/usr/include") # Absolute path in the archive. fileSize(anArArchive, "/image") # Absolute path in the archive. readDir(anArArchive, "") # Return e.g.: "src" and "/" readDir(anArArchive, "/") # Return e.g.: "usr" and "image"
Function Summary | |||||
fileSys |
| ||||
fileSys |
| ||||
void |
| ||||
array string |
| ||||
array string |
| ||||
fileType |
| ||||
fileType |
| ||||
fileMode |
| ||||
void |
| ||||
integer |
| ||||
time |
| ||||
void |
| ||||
string |
| ||||
void |
| ||||
string |
| ||||
void |
| ||||
fileMode |
| ||||
time |
| ||||
void |
| ||||
string |
| ||||
void |
| ||||
string |
| ||||
void |
| ||||
string |
| ||||
void |
| ||||
string |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
void |
| ||||
file |
|
Function Detail |
openAr
const func fileSys: openAr (inout file: arFile)
-
Open an AR archive with the given arFile.
- Parameters:
- arFile - File that contains an AR archive.
- Returns:
- a file system that accesses the AR archive.
openAr
const func fileSys: openAr (in string: arFileName)
-
Open an AR archive with the given arFileName.
- Parameters:
- arFileName - Name of the AR archive to be opened.
- Returns:
- a file system that accesses the AR archive.
readDir
const func array string: readDir (inout arArchive: ar, in string: dirPath)
-
Determine the file names in a directory inside an AR archive. Note that the function returns only the file names. Additional information must be obtained with other calls.
- Parameters:
- ar - Open AR archive.
- dirPath - Path of a directory in the AR archive.
- Returns:
- an array with the file names.
- Raises:
- RANGE_ERROR - dirPath does not use the standard path representation.
- FILE_ERROR - dirPath is not present in the AR archive.
readDir
const func array string: readDir (inout arArchive: ar, RECURSIVE)
-
Determine the file paths in an AR archive. Note that the function returns only the file paths. Additional information must be obtained with other calls.
- Parameters:
- ar - Open AR archive.
- Returns:
- an array with the file paths.
fileType
const func fileType: fileType (inout arArchive: ar, in var string: filePath)
-
Determine the type of a file in an AR archive. The function does follow symbolic links. If the chain of symbolic links is too long the function 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 invalid file names cause also FILE_ABSENT.
- Returns:
- the type of the file.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
fileTypeSL
const func fileType: fileTypeSL (inout arArchive: ar, in string: filePath)
-
Determine the type of a file in an AR archive. 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 invalid file names cause also FILE_ABSENT.
- Returns:
- the type of the file.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
getFileMode
const func fileMode: getFileMode (inout arArchive: ar, in string: filePath)
-
Determine the file mode (permissions) of a file in an AR archive. The function follows symbolic links.
- Returns:
- the file mode.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive.
setFileMode
const proc: setFileMode (inout arArchive: ar, in string: filePath, in fileMode: mode)
-
Change the file mode (permissions) of a file in an AR archive. The function follows symbolic links.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive.
fileSize
const func integer: fileSize (inout arArchive: ar, in string: filePath)
-
Determine the size of a file in an AR archive. The file size is measured in bytes. For directories a size of 0 is returned. The function follows symbolic links.
- Returns:
- the size of the file.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive.
getMTime
const func time: getMTime (inout arArchive: ar, in string: filePath)
-
Determine the modification time of a file in an AR archive. The function follows symbolic links.
- Returns:
- the modification time of the file.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive.
setMTime
const proc: setMTime (inout arArchive: ar, in string: filePath, in time: modificationTime)
-
Set the modification time of a file in an AR archive. The function follows symbolic links.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- RANGE_ERROR - aTime is invalid or cannot be converted to the system file time.
- FILE_ERROR - filePath is not present in the AR archive.
getOwner
const func string: getOwner (inout arArchive: ar, in string: filePath)
-
Determine the name of the owner (UID) of a file in an AR archive. The function follows symbolic links.
- Returns:
- the name of the file owner.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive, or the chain of symbolic links is too long.
setOwner
const proc: setOwner (inout arArchive: ar, in string: filePath, in string: owner)
-
Set the owner of a file in an AR archive. The function follows symbolic links. The AR archive format allows only a numeric UID. The owner "root" is mapped to the UID 0. Other owner names raise a RANGE_ERROR.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation, or the owner cannot be mapped to a UID.
- FILE_ERROR - filePath is not present in the AR archive, or the chain of symbolic links is too long.
getGroup
const func string: getGroup (inout arArchive: ar, in string: filePath)
-
Determine the name of the group (GID) of a file in an AR archive. The function follows symbolic links.
- Returns:
- the name of the file group.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive, or the chain of symbolic links is too long.
setGroup
const proc: setGroup (inout arArchive: ar, in string: filePath, in string: group)
-
Set the group of a file in an AR archive. The function follows symbolic links. The AR archive format allows only a numeric GID. The group "root" is mapped to the GID 0. Other group names raise a RANGE_ERROR.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation, or the group cannot be mapped to a GID.
- FILE_ERROR - filePath is not present in the AR archive, or the chain of symbolic links is too long.
getFileMode
const func fileMode: getFileMode (inout arArchive: ar, in string: filePath, SYMLINK)
-
Determine the file mode (permissions) of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link.
- Returns:
- the file mode.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
getMTime
const func time: getMTime (inout arArchive: ar, in string: filePath, SYMLINK)
-
Determine the modification time of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link.
- Returns:
- the modification time of the symbolic link.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
setMTime
const proc: setMTime (inout arArchive: ar, in string: filePath, in time: modificationTime, SYMLINK)
-
Set the modification time of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- RANGE_ERROR - modificationTime is invalid or it cannot be converted to the system file time.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
getOwner
const func string: getOwner (inout arArchive: ar, in string: filePath, SYMLINK)
-
Determine the name of the owner (UID) of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link.
- Returns:
- the name of the file owner.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
setOwner
const proc: setOwner (inout arArchive: ar, in string: filePath, in string: owner, SYMLINK)
-
Set the owner of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link. The AR archive format allows only a numeric UID. The owner "root" is mapped to the UID 0. Other owner names raise a RANGE_ERROR.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation, or the owner cannot be mapped to a UID.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
getGroup
const func string: getGroup (inout arArchive: ar, in string: filePath, SYMLINK)
-
Determine the name of the group (GID) of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link.
- Returns:
- the name of the file group.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
setGroup
const proc: setGroup (inout arArchive: ar, in string: filePath, in string: group, SYMLINK)
-
Set the group of a symbolic link in an AR archive. The function only works for symbolic links and does not follow the symbolic link. The AR archive format allows only a numeric GID. The group "root" is mapped to the GID 0. Other group names raise a RANGE_ERROR.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation, or the group cannot be mapped to a GID.
- FILE_ERROR - The file described with filePath is not present in the AR archive, or it is not a symbolic link.
readLink
const func string: readLink (inout arArchive: ar, in string: filePath)
-
Reads the destination of a symbolic link in an AR archive.
- Returns:
- The destination referred by the symbolic link.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive, or is not a symbolic link.
makeLink
const proc: makeLink (inout arArchive: ar, in string: symlinkPath, in string: targetPath)
-
Create a symbolic link in an AR archive. The symbolic link symlinkPath will refer to targetPath afterwards. The function does not follow symbolic links.
- Parameters:
- ar - Open AR archive.
- symlinkPath - Name of the symbolic link to be created.
- targetPath - String to be contained in the symbolic link.
- Raises:
- RANGE_ERROR - targetPath or symlinkPath does not use the standard path representation.
- FILE_ERROR - A system function returns an error.
getFile
const func string: getFile (inout arArchive: ar, in string: filePath)
-
Get the contents of a file in an AR archive. The function follows symbolic links.
- Returns:
- the specified file as string.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - filePath is not present in the AR archive, or is not a regular file.
putFile
const proc: putFile (inout arArchive: ar, in var string: filePath, in string: data)
-
Write data to an AR archive with the given filePath. If the file exists already, it is overwritten. The function follows symbolic links.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
makeDir
const proc: makeDir (inout arArchive: ar, in string: dirPath)
-
Create a new directory in an AR archive. The function does not follow symbolic links.
- Parameters:
- ar - Open AR archive.
- dirPath - Name of the directory to be created.
- Raises:
- RANGE_ERROR - dirPath does not use the standard path representation.
- FILE_ERROR - The file dirPath already exists.
removeFile
const proc: removeFile (inout arArchive: ar, in string: filePath)
-
Remove any file except non-empty directories from an AR archive. The function does not follow symbolic links. An attempt to remove a directory that is not empty triggers FILE_ERROR.
- Parameters:
- ar - Open AR archive.
- filePath - Name of the file to be removed.
- Raises:
- RANGE_ERROR - filePath does not use the standard path representation.
- FILE_ERROR - The file does not exist or it is a directory that is not empty.
for
const proc: for (inout string: filePath) range (inout arArchive: ar) do (in proc: statements) end for
-
For-loop which loops recursively over the paths in an AR archive.
open
const func file: open (inout arArchive: ar, in string: filePath, in string: mode)
-
Open a file with filePath and mode in in an AR archive.
|
|