SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Platform::Runtime
Class FileSystem

NonConstructibleType
   |
   +-FileSystem

Implemented in:
Platform.Runtime.FileSystem.h

class FileSystem:
private NonConstructibleType

Provides support for file system operations.

Inner Compounds, Typedefs, and Enumscollapse
struct SpaceInfo
          Device information about space.
typedef ListFilter
          A filename filter used by the list method.

Method Summarycollapse
static Bool canExecute(const Path& path)
          Tests whether the specified filesystem object can be executed by the running program.
static Bool canRead(const Path& path)
          Tests whether the specified filesystem object can be read by the running program.
static Bool canWrite(const Path& path)
          Tests whether the specified filesystem object can be written to by the running program.
static Bool changeCurrentDirectory(const Path& path)
          Changes current directory.
static Bool createDirectory(const Path& path)
          Creates a directory.
static Bool createFile(const Path& path)
          Creates an empty file.
static Bool createLink(const Path& fromPath, const Path& toPath)
          Creates a symbolic link.
static Bool exists(const Path& path)
          Tests whether the specified filesystem object exists.
static Bool isDirectory(const Path& path)
          Tests whether the specified filesystem object is a directory.
static Bool isFile(const Path& path)
          Tests whether the specified filesystem object is a file.
static Bool isLink(const Path& path)
          Tests whether the specified filesystem object is a symbolic link.
static Containers::Array<Path> list(const Path& path, const ListFilter& filter = ListFilter())
          Retrieves the list of files in a directory.
static Io::FileAccess queryFileAccess(const Path& path)
          Retrieves the access rights of the running program in relation to the specified filesystem object at the given path.
static Io::FileType queryFileType(const Path& path)
          Retrieves the type of the filesystem object at the given path.
static SpaceInfo querySpaceInfo(const Path& path)
          Retrieves the amount of space on the device pointed to by the specified path.
static Bool removeDirectory(const Path& path)
          Removes the specified directory.
static Bool removeFile(const Path& path)
          Removes the specified file or symbolic link.
static Bool renameFile(const Path& fromPath, const Path& toPath)
          Renames a file or directory.
static Long size(const Path& path)
          Retrieves the size of a filesystem object, in bytes.

 

Method Detail

canExecute[inline]

static Bool canExecute(const Path& path)

Tests whether the specified filesystem object can be executed by the running program.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object can be executed by the running program, False otherwise

canRead[inline]

static Bool canRead(const Path& path)

Tests whether the specified filesystem object can be read by the running program.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object can be read by the running program, False otherwise

canWrite[inline]

static Bool canWrite(const Path& path)

Tests whether the specified filesystem object can be written to by the running program.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object can be written to by the running program, False otherwise

changeCurrentDirectory

static Bool changeCurrentDirectory(const Path& path)

Changes current directory.

Parameters:
path - the location and the name of the directory
Returns:
True if the operation was successful, False otherwise

createDirectory

static Bool createDirectory(const Path& path)

Creates a directory. If directory already exists the operation will fail.

Parameters:
path - the location and the name of the directory
Returns:
True if the operation was successful, False otherwise

createFile

static Bool createFile(const Path& path)

Creates an empty file. If the file already exists its contents are discarded and the operation succeeds.

Parameters:
path - the location and the name of the file
Returns:
True if the operation was successful, False otherwise

createLink

static Bool createLink(const Path& fromPath, const Path& toPath)

Creates a symbolic link. If the symbolic link already exists the operation will fail.

Parameters:
fromPath - the location and the name of link source
toPath - the location and the name of link destination
Returns:
True if the operation was successful, False otherwise

exists

static Bool exists(const Path& path)

Tests whether the specified filesystem object exists.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object exists, False otherwise

isDirectory[inline]

static Bool isDirectory(const Path& path)

Tests whether the specified filesystem object is a directory.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object is a directory, False otherwise

isFile[inline]

static Bool isFile(const Path& path)

Tests whether the specified filesystem object is a file.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object is a file, False otherwise

isLink[inline]

static Bool isLink(const Path& path)

Tests whether the specified filesystem object is a symbolic link.

Parameters:
path - the location and the name of a filesystem object
Returns:
True if the specified filesystem object is a symbolic link, False otherwise

list

static Containers::Array<Path> list(const Path& path, const ListFilter& filter = ListFilter())

Retrieves the list of files in a directory.

Parameters:
path - the location and the name of a directory
filter - a filename filter
Returns:
an array of files

queryFileAccess

static Io::FileAccess queryFileAccess(const Path& path)

Retrieves the access rights of the running program in relation to the specified filesystem object at the given path.

Parameters:
path - the location and the name of the filesystem object
Returns:
access rights

queryFileType

static Io::FileType queryFileType(const Path& path)

Retrieves the type of the filesystem object at the given path.

Parameters:
path - the location and the name of the filesystem object
Returns:
the type of the filesystem object

querySpaceInfo

static SpaceInfo querySpaceInfo(const Path& path)

Retrieves the amount of space on the device pointed to by the specified path.

Parameters:
path - a location on a device
Returns:
space information for the specified device

removeDirectory

static Bool removeDirectory(const Path& path)

Removes the specified directory.

Parameters:
path - the location and the name of the directory
Returns:
True if the operation was successful, False otherwise

removeFile

static Bool removeFile(const Path& path)

Removes the specified file or symbolic link.

Parameters:
path - the location and the name of the file
Returns:
True if the operation was successful, False otherwise

renameFile

static Bool renameFile(const Path& fromPath, const Path& toPath)

Renames a file or directory. If the destination file already exists it is overwritten. If the destination directory already exists this method may fail on some systems.

Parameters:
fromPath - the location and the name of the source
toPath - the location and the name of the destination
Returns:
True if the operation was successful, False otherwise

size

static Long size(const Path& path)

Retrieves the size of a filesystem object, in bytes.

Parameters:
path - the location and the name of a filesystem object
Returns:
the size of a filesystem object, in bytes


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND