Libraries
Rpm Source Code
 previous   up   next 

Types
rpmArchive
FileSys implementation type to access a RPM archive.

rpmArchive

const type: rpmArchive

FileSys implementation type to access a RPM archive. File paths in a rpm archive can be absolute (they start with a slash) or relative (they do not start with a slash). The rpm file system does not support the concept of a current working directory. The functions chdir and getcwd are not supported by the rpm file system. Absolute and relative paths in a rpm archive can be accessed directly. Since "/" is just a normal path in a rpm archive the root path of a rpm file system is "". Possible usages of rpm file system functions are:

 getMTime(aRpmArchive, "src/drivers")   # Relative path in the archive.
 fileType(aRpmArchive, "/usr/include")  # Absolute path in the archive.
 fileSize(aRpmArchive, "/image")        # Absolute path in the archive.
 readDir(aRpmArchive, "")               # Return e.g.: "src" and "/"
 readDir(aRpmArchive, "/")              # Return e.g.: "usr" and "image"

Function Summary
fileSys
openRpm (inout file: rpmFile)
Open a RPM archive with the given rpmFile.
fileSys
openRpm (in string: rpmFileName)
Open a RPM archive with the given rpmFileName.
void
close (inout rpmArchive: rpm)
Close a RPM archive. The RPM file below stays open.
array string
readDir (inout rpmArchive: rpm, in string: dirPath)
Determine the file names in a directory inside a RPM archive.
array string
readDir (inout rpmArchive: rpm, RECURSIVE)
Determine the file paths in a RPM archive.
fileType
fileType (inout rpmArchive: rpm, in var string: filePath)
Determine the type of a file in a RPM archive.
fileType
fileTypeSL (inout rpmArchive: rpm, in string: filePath)
Determine the type of a file in a RPM archive.
fileMode
getFileMode (inout rpmArchive: rpm, in string: filePath)
Determine the file mode (permissions) of a file in a RPM archive.
void
setFileMode (inout rpmArchive: rpm, in string: filePath, in fileMode: mode)
Change the file mode (permissions) of a file in a RPM archive.
integer
fileSize (inout rpmArchive: rpm, in string: filePath)
Determine the size of a file in a RPM archive.
time
getMTime (inout rpmArchive: rpm, in string: filePath)
Determine the modification time of a file in a RPM archive.
void
setMTime (inout rpmArchive: rpm, in string: filePath, in time: modificationTime)
Set the modification time of a file in a RPM archive.
string
getOwner (inout rpmArchive: rpm, in string: filePath)
Determine the name of the owner (UID) of a file in a RPM archive.
void
setOwner (inout rpmArchive: rpm, in string: filePath, in string: owner)
Set the owner of a file in a RPM archive.
string
getGroup (inout rpmArchive: rpm, in string: filePath)
Determine the name of the group (GID) of a file in a RPM archive.
void
setGroup (inout rpmArchive: rpm, in string: filePath, in string: group)
Set the group of a file in a RPM archive.
fileMode
getFileMode (inout rpmArchive: rpm, in string: filePath, SYMLINK)
Determine the file mode (permissions) of a symbolic link in a RPM archive.
time
getMTime (inout rpmArchive: rpm, in string: filePath, SYMLINK)
Determine the modification time of a symbolic link in a RPM archive.
void
setMTime (inout rpmArchive: rpm, in string: filePath, in time: modificationTime, SYMLINK)
Set the modification time of a symbolic link in a RPM archive.
string
getOwner (inout rpmArchive: rpm, in string: filePath, SYMLINK)
Determine the name of the owner (UID) of a symbolic link in a RPM archive.
void
setOwner (inout rpmArchive: rpm, in string: filePath, in string: owner, SYMLINK)
Set the owner of a symbolic link in a RPM archive.
string
getGroup (inout rpmArchive: rpm, in string: filePath, SYMLINK)
Determine the name of the group (GID) of a symbolic link in a RPM archive.
void
setGroup (inout rpmArchive: rpm, in string: filePath, in string: group, SYMLINK)
Set the group of a symbolic link in a RPM archive.
string
readLink (inout rpmArchive: rpm, in string: filePath)
Reads the destination of a symbolic link in a RPM archive.
void
makeLink (inout rpmArchive: rpm, in string: symlinkPath, in string: targetPath)
Create a symbolic link in a RPM archive.
string
getFile (inout rpmArchive: rpm, in string: filePath)
Get the contents of a file in a RPM archive.
void
putFile (inout rpmArchive: rpm, in string: filePath, in string: data)
Write data to a RPM archive with the given filePath.
void
makeDir (inout rpmArchive: rpm, in string: dirPath)
Create a new directory in a RPM archive.
void
removeFile (inout rpmArchive: rpm, in string: filePath)
Remove any file except non-empty directories from a RPM archive.
void
for (inout string: filePath) range (inout rpmArchive: rpm) do (in proc: statements) end for
For-loop which loops recursively over the paths in a RPM archive.
file
open (inout rpmArchive: rpm, in string: filePath, in string: mode)
Open a file with filePath and mode in in a RPM archive.

Function Detail

openRpm

const func fileSys: openRpm (inout file: rpmFile)

Open a RPM archive with the given rpmFile.

Parameters:
rpmFile - File that contains a RPM archive.
Returns:
a file system that accesses the RPM archive, or fileSys.value if it could not be opened.

openRpm

const func fileSys: openRpm (in string: rpmFileName)

Open a RPM archive with the given rpmFileName.

Parameters:
rpmFileName - Name of the RPM archive to be opened.
Returns:
a file system that accesses the RPM archive, or fileSys.value if it could not be opened.

close

const proc: close (inout rpmArchive: rpm)

Close a RPM archive. The RPM file below stays open.


readDir

const func array string: readDir (inout rpmArchive: rpm, in string: dirPath)

Determine the file names in a directory inside a RPM archive. Note that the function returns only the file names. Additional information must be obtained with other calls.

Parameters:
rpm - Open RPM archive.
dirPath - Path of a directory in the RPM 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 RPM archive.

readDir

const func array string: readDir (inout rpmArchive: rpm, RECURSIVE)

Determine the file paths in a RPM archive. Note that the function returns only the file paths. Additional information must be obtained with other calls.

Parameters:
rpm - Open RPM archive.
Returns:
an array with the file paths.

fileType

const func fileType: fileType (inout rpmArchive: rpm, in var string: filePath)

Determine the type of a file in a RPM archive. The function follows 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 rpmArchive: rpm, in string: filePath)

Determine the type of a file in a RPM 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 rpmArchive: rpm, in string: filePath)

Determine the file mode (permissions) of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

setFileMode

const proc: setFileMode (inout rpmArchive: rpm, in string: filePath, in fileMode: mode)

Change the file mode (permissions) of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

fileSize

const func integer: fileSize (inout rpmArchive: rpm, in string: filePath)

Determine the size of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

getMTime

const func time: getMTime (inout rpmArchive: rpm, in string: filePath)

Determine the modification time of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

setMTime

const proc: setMTime (inout rpmArchive: rpm, in string: filePath, in time: modificationTime)

Set the modification time of a file in a RPM archive. The function follows symbolic links.

Raises:
RANGE_ERROR - filePath does not use the standard path representation.
RANGE_ERROR - modificationTime is invalid or cannot be converted to the system file time.
FILE_ERROR - filePath is not present in the RPM archive, or the chain of symbolic links is too long.

getOwner

const func string: getOwner (inout rpmArchive: rpm, in string: filePath)

Determine the name of the owner (UID) of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

setOwner

const proc: setOwner (inout rpmArchive: rpm, in string: filePath, in string: owner)

Set the owner of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

getGroup

const func string: getGroup (inout rpmArchive: rpm, in string: filePath)

Determine the name of the group (GID) of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

setGroup

const proc: setGroup (inout rpmArchive: rpm, in string: filePath, in string: group)

Set the group of a file in a RPM 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 RPM archive, or the chain of symbolic links is too long.

getFileMode

const func fileMode: getFileMode (inout rpmArchive: rpm, in string: filePath, SYMLINK)

Determine the file mode (permissions) of a symbolic link in a RPM 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 RPM archive, or it is not a symbolic link.

getMTime

const func time: getMTime (inout rpmArchive: rpm, in string: filePath, SYMLINK)

Determine the modification time of a symbolic link in a RPM 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 RPM archive, or it is not a symbolic link.

setMTime

const proc: setMTime (inout rpmArchive: rpm, in string: filePath, in time: modificationTime, SYMLINK)

Set the modification time of a symbolic link in a RPM 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 RPM archive, or it is not a symbolic link.

getOwner

const func string: getOwner (inout rpmArchive: rpm, in string: filePath, SYMLINK)

Determine the name of the owner (UID) of a symbolic link in a RPM 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 RPM archive, or it is not a symbolic link.

setOwner

const proc: setOwner (inout rpmArchive: rpm, in string: filePath, in string: owner, SYMLINK)

Set the owner of a symbolic link in a RPM 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.
FILE_ERROR - The file described with filePath is not present in the RPM archive, or it is not a symbolic link.

getGroup

const func string: getGroup (inout rpmArchive: rpm, in string: filePath, SYMLINK)

Determine the name of the group (GID) of a symbolic link in a RPM 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 RPM archive, or it is not a symbolic link.

setGroup

const proc: setGroup (inout rpmArchive: rpm, in string: filePath, in string: group, SYMLINK)

Set the group of a symbolic link in a RPM 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.
FILE_ERROR - The file described with filePath is not present in the RPM archive, or it is not a symbolic link.

readLink

const func string: readLink (inout rpmArchive: rpm, in string: filePath)

Reads the destination of a symbolic link in a RPM 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 RPM archive, or is not a symbolic link.

makeLink

const proc: makeLink (inout rpmArchive: rpm, in string: symlinkPath, in string: targetPath)

Create a symbolic link in a RPM archive. The symbolic link symlinkPath will refer to targetPath afterwards. The function does not follow symbolic links.

Parameters:
rpm - Open RPM 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 rpmArchive: rpm, in string: filePath)

Get the contents of a file in a RPM 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 RPM archive, or is not a regular file, or the chain of symbolic links is too long.

putFile

const proc: putFile (inout rpmArchive: rpm, in string: filePath, in string: data)

Write data to a RPM 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.
FILE_ERROR - The file exists, but it is not a regular file.

makeDir

const proc: makeDir (inout rpmArchive: rpm, in string: dirPath)

Create a new directory in a RPM archive. The function does not follow symbolic links.

Parameters:
rpm - Open RPM 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 rpmArchive: rpm, in string: filePath)

Remove any file except non-empty directories from a RPM archive. The function does not follow symbolic links. An attempt to remove a directory that is not empty triggers FILE_ERROR.

Parameters:
rpm - Open RPM 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 rpmArchive: rpm) do (in proc: statements) end for

For-loop which loops recursively over the paths in a RPM archive.


open

const func file: open (inout rpmArchive: rpm, in string: filePath, in string: mode)

Open a file with filePath and mode in in a RPM archive.



 previous   up   next