Class FileStat

Class holding informations on system files.

class FileStat( [path] )

more...

Summary

accessPOSIX access mod
atimeLast access time, expressed as a instance
attribsDOS Attribute
ctimeCreation time or last attribute change time, expressed as a instance
ftypeFile type; can be one of the following constants (declared in this class)
groupGroup ID of the given file
mtimeLast modify time, expressed as a instance
ownerOwner ID of the given file
sizeFile size
read()Fills the data in this instance reading them from a system file.

Detailed description

Class holding informations on system files.

The FileStat class holds informations on a single directory entry.

It is possible to pass a path parameter, in which case, if the given file is found, the contents of this class is filled with the stat data from the required file, otherwise an IoError is raised. The FileStat.read method would search for the required file without raising in case it is not found, so if it preferable not to raise on failure (i.e. because searching the most fitting of a list of possibly existing files), it is possiblo to create the FileStat object without parameters and the use the read method iteratively.

Both access and attribs properties are given a value respectively only on POSIX or MS-Windows systems; their value is the underlying numeric value the system provides. The ctime property has a different meaning in MS-Windows and POSIX system. In the former, is the time at which the file has been created; in the latter is the time when the file ownership flags have been last changed, which may or may not be the same as file creation time.

Times are returned as a TimeStamp class instance; the time is always expressed as local system time.

Properties

access

POSIX access mod

atime

Last access time, expressed as a instance

attribs

DOS Attribute

ctime

Creation time or last attribute change time, expressed as a instance

ftype

File type; can be one of the following constants (declared in this class)

group

Group ID of the given file

mtime

Last modify time, expressed as a instance

owner

Owner ID of the given file

size

File size

Methods

read()

Fills the data in this instance reading them from a system file.

FileStat.read( filename )

filenameRelative or absolute path to a file for which stats must be read
Returns:True on success, false if the file cannot be queried.

Fills the contents of this object with informations on the given file. If the stats of the required file can be read, the function returns true.


Made with faldoc 2.1.0