Table Of Contents

Previous topic

QAbstractFileEngine

Next topic

QDir

QFSFileEngine

Inheritance diagram of QFSFileEngine

Synopsis

Functions

Static functions

Detailed Description

The PySide.QtCore.QFSFileEngine class implements Qt’s default file engine.

This class is part of the file engine framework in Qt. If you only want to access files or directories, use PySide.QtCore.QFile , PySide.QtCore.QFileInfo or PySide.QtCore.QDir instead.

PySide.QtCore.QFSFileEngine is the default file engine for accessing regular files. It is provided for convenience; by subclassing this class, you can alter its behavior slightly, without having to write a complete PySide.QtCore.QAbstractFileEngine subclass. To install your custom file engine, you must also subclass PySide.QtCore.QAbstractFileEngineHandler and create an instance of your handler.

It can also be useful to create a PySide.QtCore.QFSFileEngine object directly if you need to use the local file system inside QAbstractFileEngine.create() , in order to avoid recursion (as higher-level classes tend to call QAbstractFileEngine.create() ).

class PySide.QtCore.QFSFileEngine
class PySide.QtCore.QFSFileEngine(file)
Parameters:file – unicode

Constructs a PySide.QtCore.QFSFileEngine .

Constructs a PySide.QtCore.QFSFileEngine for the file name file .

static PySide.QtCore.QFSFileEngine.currentPath([path=""])
Parameters:path – unicode
Return type:unicode

For Unix, returns the current working directory for the file engine.

For Windows, returns the canonicalized form of the current path used by the file engine for the drive specified by fileName . On Windows, each drive has its own current directory, so a different path is returned for file names that include different drive names (e.g. A: or C:).

static PySide.QtCore.QFSFileEngine.drives()
Return type:

For Windows, returns the list of drives in the file system as a list of PySide.QtCore.QFileInfo objects. On unix, Mac OS X and Windows CE, only the root path is returned. On Windows, this function returns all drives (A:, C:, D:, etc.).

For Unix, the list contains just the root path “/”.

PySide.QtCore.QFSFileEngine.endEntryList()
Return type:PySide.QtCore.QAbstractFileEngineIterator
static PySide.QtCore.QFSFileEngine.homePath()
Return type:unicode

Returns the home path of the current user.

PySide.QtCore.QFSFileEngine.open(flags, fd)
Parameters:
  • flagsPySide.QtCore.QIODevice.OpenMode
  • fdPySide.QtCore.int
Return type:

PySide.QtCore.bool

static PySide.QtCore.QFSFileEngine.rootPath()
Return type:unicode

Returns the root path.

static PySide.QtCore.QFSFileEngine.setCurrentPath(path)
Parameters:path – unicode
Return type:PySide.QtCore.bool

Sets the current path (e.g., for PySide.QtCore.QDir ), to path . Returns true if the new path exists; otherwise this function does nothing, and returns false.

static PySide.QtCore.QFSFileEngine.tempPath()
Return type:unicode

Returns the temporary path (i.e., a path in which it is safe to store temporary files).