FileSystem this object allows you to get information about the files and directories.


Lib.Sys.FileSystem.exists(path)

Tells if the file or directory specified by path exists.
If path is nil, the result is unspecified.

path - file / directory path location

Lib.Sys.FileSystem.rename(path, newPath)

Renames/moves the file or directory specified by path to newPath.
If path is not a valid file system entry, or if it is not accessible, or if newPath is not accessible, an exception is thrown.
If path or newPath are nil, the result is unspecified.

path - file / directory path location

newPath - file path to rename or move

Lib.Sys.FileSystem.stat(path)

Returns File Stat information on the file or directory specified by path.
If path is nil, the result is unspecified.

File Stat object fields:

gid : Int - The user group id for the file's owner.
uid : Int - The user id for the file's owner.
atime : Date - The last access time for the file (when enabled by the file system).
mtime : Date - The last modification time for the file.
ctime : Date - The creation time for the file (not all file systems support this).
size : Int - The size of the file, in bytes. 
dev : Int - The device on which stat resides.
ino : Int - The inode number for stat.
nlink : Int - The number of hard links to stat.
rdev : Int - The device type on which stat resides (special files only).
mode : Int - The permission bits of stat. The meaning of the bits is platform dependent.

path - file / directory path location

Lib.Sys.FileSystem.fullPath(relPath)

Returns the full path of the file or directory specified by relPath, which is relative to the current working directory. Symlinks will be followed and the path will be normalized.
If relPath is nil, the result is unspecified.

relPath - relative path to file / directory

Lib.Sys.FileSystem.absolutePath(relPath)

Returns the absolute / full path of the file or directory specified by relPath,
which is relative to the current working directory. The path doesn't have to exist.
If relPath is nil, the result is unspecified.

relPath - relative path to file / directory

Lib.Sys.FileSystem.isDirectory(path)

Tells if the file or directory specified by path is a directory.
If path is not a valid file system entry or if its destination is not accessible, an exception is thrown.
If path is nil, the result is unspecified.

path - file / directory path location

Lib.Sys.FileSystem.createDirectory(path)

Creates a directory specified by path.
This method is recursive: The parent directories don't have to exist.
If the directory cannot be created, an exception is thrown.
If path is nil, the result is unspecified.

path - directory path location

Lib.Sys.FileSystem.deleteFile(path)

Deletes the file specified by path.
If path does not denote a valid file, or if that file cannot be deleted, an exception is thrown.
If path is nil, the result is unspecified.

path - file path location

Lib.Sys.FileSystem.deleteDirectory(path)

Deletes the directory specified by path.
If path does not denote a valid directory, or if that directory cannot
be deleted, an exception is thrown.
If path is nil, the result is unspecified.

path - directory path location

Lib.Sys.FileSystem.readDirectory(path)

Returns the names of all files and directories in the directory specified
by path.
If path does not denote a valid directory, an exception is thrown.
If path is nil, the result is unspecified.

path - directory path location


Examples:


root = Lib.Media.FileSystem.File.applicationStorageDirectory.nativePath

if not Lib.Sys.FileSystem.exists(root) then

       Lib.Sys.FileSystem.createDirectory(root)

end

Created with the Personal Edition of HelpNDoc: Create help files for the Qt Help Framework