The QFileInfo class provides system-independent file information. More...
#include <qfileinfo.h>
QFileInfo provides information about a file's name and position (path) in the file system, its access rights and whether it is a directory or a symbolic link. Its size and last modified/read times are also available.
To speed up performance QFileInfo caches information about the file. Since files can be changed by other users or programs, or even by other parts of the same program there is a function that refreshes the file information; refresh(). If you would rather like a QFileInfo to access the file system every time you request information from it, you can call the function setCaching( FALSE ).
A QFileInfo can point to a file using either a relative or an absolute file path. Absolute file paths begin with the directory separator ('/') or a drive specification (not applicable to UNIX). Relative file names begin with a directory name or a file name and specify a path relative to the current directory. An example of an absolute path is the string "/tmp/quartz". A relative path might look like "src/fatlib". You can use the function isRelative() to check if a QFileInfo is using a relative or an absolute file path. You can call the function convertToAbs() to convert a relative QFileInfo to an absolute one.
If you need to read and traverse directories, see the QDir class.
Examples: dirview/dirview.cpp biff/biff.cpp
Constructs a new empty QFileInfo.
Constructs a new QFileInfo that gives information about the file named fileName in the directory d.
If the directory has a relative path, the QFileInfo will also have one.
See also: isRelative().
Constructs a new QFileInfo that gives information about file.
If the file has a relative path, the QFileInfo will also have one.
See also: isRelative().
Constructs a new QFileInfo that is a copy of fi.
Constructs a new QFileInfo that gives information about the given file. The string given can be an absolute or a relative file path.
See also: bool, setFile(const, char*), isRelative(), QDir::setCurrent() and QDir::isRelativePath().
Destroys the QFileInfo.
Returns the absolute path name.
The absolute path name is the file name including the absolute path. If the QFileInfo is absolute (i.e. not relative) this function will return the same string as filePath().
Note that this function can be time-consuming under UNIX. (in the order of milliseconds on a 486 DX2/66 running Linux).
See also: isRelative() and filePath().
Examples: biff/biff.cpp
Returns the base name of the file.
The base name consists of all characters in the file name up to (but not including) the first '.' character. The path is not included.
Example:
QFileInfo fi( "/tmp/abdomen.lower" );
QString base = fi.baseName(); // base = "abdomen"
See also: fileName() and extension().
Returns TRUE if caching is enabled.
See also: setCaching() and refresh().
Converts the file path name to an absolute path.
If it is already absolute nothing is done.
See also: filePath() and isRelative().
Returns the directory path of the file.
If the QFileInfo is relative and absPath is FALSE, the QDir will be relative, otherwise it will be absolute.
See also: dirPath(), filePath(), fileName() and isRelative().
Returns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relative, otherweturns the directory path of the file.
If be relati