<class name="QFileInfo" doc="/** <p>The <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> class provides system-independent file information.</p> <p><a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> provides information about a file's name and position (path) in the file system, its access rights and whether it is a directory or symbolic link, etc. The file's size and last modified/read times are also available. <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> can also be used to obtain information about a Qt <a href="%2E%2E/resources.html#resource-system">resource</tt></a>.</p> <p>A <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> can point to a file with either a relative or an absolute file path. Absolute file paths begin with the directory separator &quot;/&quot; (or with a drive specification on Windows). Relative file names begin with a directory name or a file name and specify a path relative to the current working directory. An example of an absolute path is the string &quot;/tmp/quartz&quot;. A relative path might look like &quot;src/fatlib&quot;. You can use the function <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> to check whether a <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> is using a relative or an absolute file path. You can call the function <a href="QFileInfo.html#makeAbsolute()"><tt>makeAbsolute</tt></a> to convert a relative <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a>'s path to an absolute path.</p> <p>The file that the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> works on is set in the constructor or later with <a href="QFileInfo.html#setFile(com.trolltech.qt.core.QFile)"><tt>setFile</tt></a>. Use <a href="QFileInfo.html#exists()"><tt>exists</tt></a> to see if the file exists and <a href="QFileInfo.html#size()"><tt>size</tt></a> to get its size.</p> <p>Some of <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a>'s functions query the file system, but for performance reasons, some functions only operate on the file name itself. For example: To return the absolute path of a relative file name, <a href="QFileInfo.html#absolutePath()"><tt>absolutePath</tt></a> has to query the file system. The <a href="QFileInfo.html#path()"><tt>path</tt></a> function, however, can work on the file name directly, and so it is faster. By convention, <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> interprets any path that ends with a slash '/' as a directory (e.g&#x2e;, &quot;C:/WINDOWS/&quot;), and those without a trailing slash (e.g&#x2e;, &quot;C:/WINDOWS/hosts.txt&quot;) are treated as files.</p> <p>To speed up performance, <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> caches information about the file. Because 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: <a href="QFileInfo.html#refresh()"><tt>refresh</tt></a>. If you want to switch off a <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a>'s caching and force it to access the file system every time you request information from it call <a href="QFileInfo.html#setCaching(boolean)"><tt>setCaching</tt></a>(false).</p> <p>The file's type is obtained with <a href="QFileInfo.html#isFile()"><tt>isFile</tt></a>, <a href="QFileInfo.html#isDir()"><tt>isDir</tt></a> and <a href="QFileInfo.html#isSymLink()"><tt>isSymLink</tt></a>. The <a href="QFileInfo.html#symLinkTarget()"><tt>symLinkTarget</tt></a> function provides the name of the file the symlink points to.</p> <p>On Unix (including Mac OS X), the symlink has the same <a href="QFileInfo.html#size()"><tt>size</tt></a> has the file it points to, because Unix handles symlinks transparently; similarly, opening a symlink using <a href="QFile.html"><tt>QFile</tt></a> effectively opens the link's target. For example:</p> <pre> #ifdef Q_OS_UNIX QFileInfo info1(&quot;/home/bob/bin/untabify&quot;); info1.isSymLink(); <span class="comment">// returns true</span> info1.absoluteFilePath(); <span class="comment">// returns &quot;/home/bob/bin/untabify&quot;</span> info1.size(); <span class="comment">// returns 56201</span> info1.symLinkTarget(); <span class="comment">// returns &quot;/opt/pretty++/bin/untabify&quot;</span> QFileInfo info2(info1.symLinkTarget()); info1.isSymLink(); <span class="comment">// returns false</span> info1.absoluteFilePath(); <span class="comment">// returns &quot;/opt/pretty++/bin/untabify&quot;</span> info1.size(); <span class="comment">// returns 56201</span> #endif</pre> <p>On Windows, symlinks (shortcuts) are <tt>.lnk</tt> files. The reported <a href="QFileInfo.html#size()"><tt>size</tt></a> is that of the symlink (not the link's target), and opening a symlink using <a href="QFile.html"><tt>QFile</tt></a> opens the <tt>.lnk</tt> file. For example:</p> <pre> #ifdef Q_OS_WIN QFileInfo info1(&quot;C:\\Documents and Settings\\Bob\\untabify.lnk&quot;); info1.isSymLink(); <span class="comment">// returns true</span> info1.absoluteFilePath(); <span class="comment">// returns &quot;C:/Documents and Settings/Bob/untabify.lnk&quot;</span> info1.size(); <span class="comment">// returns 743</span> info1.symLinkTarget(); <span class="comment">// returns &quot;C:/Pretty++/untabify&quot;</span> QFileInfo info2(info1.symLinkTarget()); info1.isSymLink(); <span class="comment">// returns false</span> info1.absoluteFilePath(); <span class="comment">// returns &quot;C:/Pretty++/untabify&quot;</span> info1.size(); <span class="comment">// returns 63942</span> #endif</pre> <p>Elements of the file's name can be extracted with <a href="QFileInfo.html#path()"><tt>path</tt></a> and <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a>. The <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a>'s parts can be extracted with <a href="QFileInfo.html#baseName()"><tt>baseName</tt></a> and extension().</p> <p>The file's dates are returned by <a href="QFileInfo.html#created()"><tt>created</tt></a>, <a href="QFileInfo.html#lastModified()"><tt>lastModified</tt></a> and <a href="QFileInfo.html#lastRead()"><tt>lastRead</tt></a>. Information about the file's access permissions is obtained with <a href="QFileInfo.html#isReadable()"><tt>isReadable</tt></a>, <a href="QFileInfo.html#isWritable()"><tt>isWritable</tt></a> and <a href="QFileInfo.html#isExecutable()"><tt>isExecutable</tt></a>. The file's ownership is available from <a href="QFileInfo.html#owner()"><tt>owner</tt></a>, <a href="QFileInfo.html#ownerId()"><tt>ownerId</tt></a>, <a href="QFileInfo.html#group()"><tt>group</tt></a> and <a href="QFileInfo.html#groupId()"><tt>groupId</tt></a>. You can examine a file's permissions and ownership in a single statement using the <a href="QFileInfo.html#permission(com.trolltech.qt.core.QFile.Permissions)"><tt>permission</tt></a> function.</p> @see <a href="QDir.html"><tt>QDir</tt></a> @see <a href="QFile.html"><tt>QFile</tt></a> */"> <method name="public QFileInfo(com.trolltech.qt.core.QDir dir, java.lang.String file)" doc="/** <p>Constructs a new <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> that gives information about the given <tt>file</tt> in the directory <tt>dir</tt>.</p> <p>If <tt>dir</tt> has a relative path, the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> will also have a relative path.</p> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> */"/> <method name="public QFileInfo(com.trolltech.qt.core.QFile file)" doc="/** <p>Constructs a new <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> that gives information about file <tt>file</tt>.</p> <p>If the <tt>file</tt> has a relative path, the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> will also have a relative path.</p> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> */"/> <method name="public QFileInfo(com.trolltech.qt.core.QFileInfo fileinfo)" doc="/** <p>Constructs a new <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> that is a copy of the given <tt>fileinfo</tt>.</p> */"/> <method name="public QFileInfo(java.lang.String file)" doc="/** <p>Constructs a new <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> that gives information about the given file. The <tt>file</tt> can also include an absolute or relative path.</p> @see <a href="QFileInfo.html#setFile(com.trolltech.qt.core.QFile)"><tt>setFile</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <tt>QDir::setCurrent</tt> @see <tt>QDir::isRelativePath</tt> */"/> <method name="public QFileInfo()" doc="/** <p>Constructs an empty <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> object.</p> <p>Note that an empty <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> object contain no file reference.</p> @see <a href="QFileInfo.html#setFile(com.trolltech.qt.core.QFile)"><tt>setFile</tt></a> */"/> <method name="public final com.trolltech.qt.core.QDir absoluteDir()" doc="/** <p>Returns the file's absolute path as a <a href="QDir.html"><tt>QDir</tt></a> object.</p> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#dir()"><tt>dir</tt></a> */"/> <method name="public final java.lang.String absoluteFilePath()" doc="/** <p>Returns the absolute path including the file name.</p> <p>The absolute path name consists of the full path and the file name. On Unix this will always begin with the root, '/', directory. On Windows this will always begin 'D:/' where D is a drive letter, except for network shares that are not mapped to a drive letter, in which case the path will begin '//sharename/'.</p> <p>This function returns the same as <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a>, unless <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> is true.</p> <p>If the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> is empty it returns QDir::currentPath().</p> <p>This function can be time consuming under Unix (in the order of milliseconds).</p> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> */"/> <method name="public final java.lang.String absolutePath()" doc="/** <p>Returns the file's path absolute path. This doesn't include the file name.</p> @see <a href="QFileInfo.html#dir()"><tt>dir</tt></a> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#path()"><tt>path</tt></a> */"/> <method name="public final java.lang.String baseName()" doc="/** <p>Returns the base name of the file without the path.</p> <p>The base name consists of all characters in the file up to (but not including) the <i>first</i> '.' character.</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/tmp/archive.tar.gz&quot;); QString base = fi.baseName(); <span class="comment">// base = &quot;archive&quot;</span></pre> <p>The base name of a file is computed equally on all platforms, independent of file naming conventions (e.g&#x2e;, &quot;.bashrc&quot; on Unix has an empty base name, and the suffix is &quot;bashrc&quot;).</p> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#suffix()"><tt>suffix</tt></a> @see <a href="QFileInfo.html#completeSuffix()"><tt>completeSuffix</tt></a> @see <a href="QFileInfo.html#completeBaseName()"><tt>completeBaseName</tt></a> */"/> <method name="public final java.lang.String bundleName()" doc="/** <p>Returns the name of the bundle.</p> <p>On Mac OS X this returns the proper localized name for a bundle if the path <a href="QFileInfo.html#isBundle()"><tt>isBundle</tt></a>. On all other platforms an empty <a href="%2E%2E/porting4.html#qstring"><tt>QString</tt></a> is returned.</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/Applications/Safari.app&quot;); QString bundle = fi.bundleName(); <span class="comment">// name = &quot;Safari&quot;</span></pre> @see <a href="QFileInfo.html#isBundle()"><tt>isBundle</tt></a> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#baseName()"><tt>baseName</tt></a> @see <tt>extension</tt> */"/> <method name="public final boolean caching()" doc="/** <p>Returns true if caching is enabled; otherwise returns false.</p> @see <a href="QFileInfo.html#setCaching(boolean)"><tt>setCaching</tt></a> @see <a href="QFileInfo.html#refresh()"><tt>refresh</tt></a> */"/> <method name="public final java.lang.String canonicalFilePath()" doc="/** <p>Returns the canonical path, i.e&#x2e; a path without symbolic links or redundant &quot;.&quot; or &quot;..&quot; elements.</p> <p>On systems that do not have symbolic links this function will always return the same string that <a href="QFileInfo.html#absoluteFilePath()"><tt>absoluteFilePath</tt></a> returns. If the canonical path does not exist (normally due to dangling symbolic links) <a href="QFileInfo.html#canonicalFilePath()"><tt>canonicalFilePath</tt></a> returns an empty string.</p> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#absoluteFilePath()"><tt>absoluteFilePath</tt></a> */"/> <method name="public final java.lang.String canonicalPath()" doc="/** <p>Returns the canonical path, i.e&#x2e; a path without symbolic links or redundant &quot;.&quot; or &quot;..&quot; elements.</p> <p>On systems that do not have symbolic links this function will always return the same string that <a href="QFileInfo.html#absolutePath()"><tt>absolutePath</tt></a> returns. If the canonical path does not exist (normally due to dangling symbolic links) <a href="QFileInfo.html#canonicalPath()"><tt>canonicalPath</tt></a> returns an empty string.</p> @see <a href="QFileInfo.html#absolutePath()"><tt>absolutePath</tt></a> */"/> <method name="public final java.lang.String completeBaseName()" doc="/** <p>Returns the complete base name of the file without the path.</p> <p>The complete base name consists of all characters in the file up to (but not including) the <i>last</i> '.' character.</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/tmp/archive.tar.gz&quot;); QString base = fi.completeBaseName(); <span class="comment">// base = &quot;archive.tar&quot;</span></pre> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#suffix()"><tt>suffix</tt></a> @see <a href="QFileInfo.html#completeSuffix()"><tt>completeSuffix</tt></a> @see <a href="QFileInfo.html#baseName()"><tt>baseName</tt></a> */"/> <method name="public final java.lang.String completeSuffix()" doc="/** <p>Returns the complete suffix of the file.</p> <p>The complete suffix consists of all characters in the file after (but not including) the first '.'&#x2e;</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/tmp/archive.tar.gz&quot;); QString ext = fi.completeSuffix(); <span class="comment">// ext = &quot;tar.gz&quot;</span></pre> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#suffix()"><tt>suffix</tt></a> @see <a href="QFileInfo.html#baseName()"><tt>baseName</tt></a> @see <a href="QFileInfo.html#completeBaseName()"><tt>completeBaseName</tt></a> */"/> <method name="public final com.trolltech.qt.core.QDateTime created()" doc="/** <p>Returns the date and time when the file was created.</p> <p>On most Unix systems, this function returns the time of the last status change. A status change occurs when the file is created, but it also occurs whenever the user writes or sets inode information (for example, changing the file permissions).</p> <p>If neither creation time nor &quot;last status change&quot; time are not available, returns the same as <a href="QFileInfo.html#lastModified()"><tt>lastModified</tt></a>.</p> @see <a href="QFileInfo.html#lastModified()"><tt>lastModified</tt></a> @see <a href="QFileInfo.html#lastRead()"><tt>lastRead</tt></a> */"/> <method name="public final com.trolltech.qt.core.QDir dir()" doc="/** <p>Returns the path of the object's parent directory as a <a href="QDir.html"><tt>QDir</tt></a> object.</p> <p><b>Note:</b> The <a href="QDir.html"><tt>QDir</tt></a> returned always corresponds to the object's parent directory, even if the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> represents a directory.</p> @see <tt>dirPath</tt> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#absoluteDir()"><tt>absoluteDir</tt></a> */"/> <method name="public final boolean exists()" doc="/** <p>Returns true if the file exists; otherwise returns false.</p> */"/> <method name="public final java.lang.String fileName()" doc="/** <p>Returns the name of the file, excluding the path.</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/tmp/archive.tar.gz&quot;); QString name = fi.fileName(); <span class="comment">// name = &quot;archive.tar.gz&quot;</span></pre> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#baseName()"><tt>baseName</tt></a> @see <tt>extension</tt> */"/> <method name="public final java.lang.String filePath()" doc="/** <p>Returns the file name, including the path (which may be absolute or relative).</p> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#absoluteFilePath()"><tt>absoluteFilePath</tt></a> */"/> <method name="public final java.lang.String group()" doc="/** <p>Returns the group of the file. On Windows, on systems where files do not have groups, or if an error occurs, an empty string is returned.</p> <p>This function can be time consuming under Unix (in the order of milliseconds).</p> @see <a href="QFileInfo.html#groupId()"><tt>groupId</tt></a> @see <a href="QFileInfo.html#owner()"><tt>owner</tt></a> @see <a href="QFileInfo.html#ownerId()"><tt>ownerId</tt></a> */"/> <method name="public final int groupId()" doc="/** <p>Returns the id of the group the file belongs to.</p> <p>On Windows and on systems where files do not have groups this function always returns (uint) -2.</p> @see <a href="QFileInfo.html#group()"><tt>group</tt></a> @see <a href="QFileInfo.html#owner()"><tt>owner</tt></a> @see <a href="QFileInfo.html#ownerId()"><tt>ownerId</tt></a> */"/> <method name="public final boolean isAbsolute()" doc="/** <p>Returns true if the file path name is absolute, otherwise returns false if the path is relative.</p> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> */"/> <method name="public final boolean isBundle()" doc="/** <p>Returns true if this object points to a bundle or to a symbolic link to a bundle on Mac OS X; otherwise returns false.</p> @see <a href="QFileInfo.html#isDir()"><tt>isDir</tt></a> @see <a href="QFileInfo.html#isSymLink()"><tt>isSymLink</tt></a> @see <a href="QFileInfo.html#isFile()"><tt>isFile</tt></a> */"/> <method name="public final boolean isDir()" doc="/** <p>Returns true if this object points to a directory or to a symbolic link to a directory; otherwise returns false.</p> @see <a href="QFileInfo.html#isFile()"><tt>isFile</tt></a> @see <a href="QFileInfo.html#isSymLink()"><tt>isSymLink</tt></a> @see <a href="QFileInfo.html#isBundle()"><tt>isBundle</tt></a> */"/> <method name="public final boolean isExecutable()" doc="/** <p>Returns true if the file is executable; otherwise returns false.</p> @see <a href="QFileInfo.html#isReadable()"><tt>isReadable</tt></a> @see <a href="QFileInfo.html#isWritable()"><tt>isWritable</tt></a> @see <a href="QFileInfo.html#permission(com.trolltech.qt.core.QFile.Permissions)"><tt>permission</tt></a> */"/> <method name="public final boolean isFile()" doc="/** <p>Returns true if this object points to a file or to a symbolic link to a file. Returns false if the object points to something which isn't a file, such as a directory.</p> @see <a href="QFileInfo.html#isDir()"><tt>isDir</tt></a> @see <a href="QFileInfo.html#isSymLink()"><tt>isSymLink</tt></a> @see <a href="QFileInfo.html#isBundle()"><tt>isBundle</tt></a> */"/> <method name="public final boolean isHidden()" doc="/** <p>Returns true if this is a `hidden' file; otherwise returns false.</p> <p><b>Note:</b> This function returns true for the special entries &quot;.&quot; and &quot;..&quot; on Unix, even though QDir::entryList threats them as shown.</p> */"/> <method name="public final boolean isReadable()" doc="/** <p>Returns true if the user can read the file; otherwise returns false.</p> @see <a href="QFileInfo.html#isWritable()"><tt>isWritable</tt></a> @see <a href="QFileInfo.html#isExecutable()"><tt>isExecutable</tt></a> @see <a href="QFileInfo.html#permission(com.trolltech.qt.core.QFile.Permissions)"><tt>permission</tt></a> */"/> <method name="public final boolean isRelative()" doc="/** <p>Returns true if the file path name is relative, otherwise returns false if the path is absolute (e.g&#x2e; under Unix a path is absolute if it begins with a &quot;/&quot;).</p> @see <a href="QFileInfo.html#isAbsolute()"><tt>isAbsolute</tt></a> */"/> <method name="public final boolean isRoot()" doc="/** <p>Returns true if the object points to a directory or to a symbolic link to a directory, and that directory is the root directory; otherwise returns false.</p> */"/> <method name="public final boolean isSymLink()" doc="/** <p>Returns true if this object points to a symbolic link (or to a shortcut on Windows); otherwise returns false.</p> <p>On Unix (including Mac OS X), opening a symlink effectively opens the <a href="QFileInfo.html#symLinkTarget()">link's target</tt></a>. On Windows, it opens the <tt>.lnk</tt> file itself.</p> <p>Example:</p> <pre> QFileInfo info(fileName); if (info.isSymLink()) fileName = info.symLinkTarget();</pre> @see <a href="QFileInfo.html#isFile()"><tt>isFile</tt></a> @see <a href="QFileInfo.html#isDir()"><tt>isDir</tt></a> @see <a href="QFileInfo.html#symLinkTarget()"><tt>symLinkTarget</tt></a> */"/> <method name="public final boolean isWritable()" doc="/** <p>Returns true if the user can write to the file; otherwise returns false.</p> @see <a href="QFileInfo.html#isReadable()"><tt>isReadable</tt></a> @see <a href="QFileInfo.html#isExecutable()"><tt>isExecutable</tt></a> @see <a href="QFileInfo.html#permission(com.trolltech.qt.core.QFile.Permissions)"><tt>permission</tt></a> */"/> <method name="public final com.trolltech.qt.core.QDateTime lastModified()" doc="/** <p>Returns the date and time when the file was last modified.</p> @see <a href="QFileInfo.html#created()"><tt>created</tt></a> @see <a href="QFileInfo.html#lastRead()"><tt>lastRead</tt></a> */"/> <method name="public final com.trolltech.qt.core.QDateTime lastRead()" doc="/** <p>Returns the date and time when the file was last read (accessed).</p> <p>On platforms where this information is not available, returns the same as <a href="QFileInfo.html#lastModified()"><tt>lastModified</tt></a>.</p> @see <a href="QFileInfo.html#created()"><tt>created</tt></a> @see <a href="QFileInfo.html#lastModified()"><tt>lastModified</tt></a> */"/> <method name="public final boolean makeAbsolute()" doc="/** <p>Converts the file's path to an absolute path if it is not already in that form. Returns true to indicate that the path was converted; otherwise returns false to indicate that the path was already absolute.</p> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> */"/> <method name="public final java.lang.String owner()" doc="/** <p>Returns the owner of the file. On systems where files do not have owners, or if an error occurs, an empty string is returned.</p> <p>This function can be time consuming under Unix (in the order of milliseconds).</p> @see <a href="QFileInfo.html#ownerId()"><tt>ownerId</tt></a> @see <a href="QFileInfo.html#group()"><tt>group</tt></a> @see <a href="QFileInfo.html#groupId()"><tt>groupId</tt></a> */"/> <method name="public final int ownerId()" doc="/** <p>Returns the id of the owner of the file.</p> <p>On Windows and on systems where files do not have owners this function returns ((uint) -2).</p> @see <a href="QFileInfo.html#owner()"><tt>owner</tt></a> @see <a href="QFileInfo.html#group()"><tt>group</tt></a> @see <a href="QFileInfo.html#groupId()"><tt>groupId</tt></a> */"/> <method name="public final java.lang.String path()" doc="/** <p>Returns the file's path. This doesn't include the file name.</p> @see <a href="QFileInfo.html#dir()"><tt>dir</tt></a> @see <a href="QFileInfo.html#filePath()"><tt>filePath</tt></a> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <a href="QFileInfo.html#absolutePath()"><tt>absolutePath</tt></a> */"/> <method name="public final boolean permission(com.trolltech.qt.core.QFile.Permissions permissions)" doc="/** <p>Tests for file permissions. The <tt>permissions</tt> argument can be several flags of type QFile::Permissions OR-ed together to check for permission combinations.</p> <p>On systems where files do not have permissions this function always returns true.</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/tmp/archive.tar.gz&quot;); if (fi.permission(QFile::WriteUser | QFile::ReadGroup)) qWarning(&quot;I can change the file; my group can read the file&quot;); if (fi.permission(QFile::WriteGroup | QFile::WriteOther)) qWarning(&quot;The group or others can change the file&quot;);</pre> @see <a href="QFileInfo.html#isReadable()"><tt>isReadable</tt></a> @see <a href="QFileInfo.html#isWritable()"><tt>isWritable</tt></a> @see <a href="QFileInfo.html#isExecutable()"><tt>isExecutable</tt></a> */"/> <method name="public final com.trolltech.qt.core.QFile.Permissions permissions()" doc="/** <p>Returns the complete OR-ed together combination of QFile::Permissions for the file.</p> */"/> <method name="public final void refresh()" doc="/** <p>Refreshes the information about the file, i.e&#x2e; reads in information from the file system the next time a cached property is fetched.</p> */"/> <method name="public final void setCaching(boolean on)" doc="/** <p>If <tt>on</tt> is true, enables caching of file information. If <tt>on</tt> is false caching is disabled.</p> <p>When caching is enabled, <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> reads the file information from the file system the first time it's needed, but generally not later.</p> <p>Caching is enabled by default.</p> @see <a href="QFileInfo.html#refresh()"><tt>refresh</tt></a> @see <a href="QFileInfo.html#caching()"><tt>caching</tt></a> */"/> <method name="public final void setFile(com.trolltech.qt.core.QDir dir, java.lang.String file)" doc="/** <p>Sets the file that the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> provides information about to <tt>file</tt> in directory <tt>dir</tt>.</p> <p>If <tt>file</tt> includes a relative path, the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> will also have a relative path.</p> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> */"/> <method name="public final void setFile(java.lang.String file)" doc="/** <p>Sets the file that the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> provides information about to <tt>file</tt>.</p> <p>The <tt>file</tt> can also include an absolute or relative file path. Absolute paths begin with the directory separator (e.g&#x2e; &quot;/&quot; under Unix) or a drive specification (under Windows). Relative file names begin with a directory name or a file name and specify a path relative to the current directory.</p> <p>Example:</p> <pre> QString absolute = &quot;/local/bin&quot;; QString relative = &quot;local/bin&quot;; QFileInfo absFile(absolute); QFileInfo relFile(relative); QDir::setCurrent(QDir::rootPath()); <span class="comment"> // absFile and relFile now point to the same file</span> QDir::setCurrent(&quot;/tmp&quot;); <span class="comment"> // absFile now points to &quot;/local/bin&quot;,</span> <span class="comment"> // while relFile points to &quot;/tmp/local/bin&quot;</span></pre> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> @see <tt>QDir::setCurrent</tt> @see <tt>QDir::isRelativePath</tt> */"/> <method name="public final void setFile(com.trolltech.qt.core.QFile file)" doc="/** <p>Sets the file that the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> provides information about to <tt>file</tt>.</p> <p>If <tt>file</tt> includes a relative path, the <a href="QFileInfo.html#QFileInfo()"><tt>QFileInfo</tt></a> will also have a relative path.</p> @see <a href="QFileInfo.html#isFile()"><tt>isFile</tt></a> @see <a href="QFileInfo.html#isRelative()"><tt>isRelative</tt></a> */"/> <method name="public final long size()" doc="/** <p>Returns the file size in bytes. If the file does not exist or cannot be fetched, 0 is returned.</p> @see <a href="QFileInfo.html#exists()"><tt>exists</tt></a> */"/> <method name="public final java.lang.String suffix()" doc="/** <p>Returns the suffix of the file.</p> <p>The suffix consists of all characters in the file after (but not including) the last '.'&#x2e;</p> <p>Example:</p> <pre> QFileInfo fi(&quot;/tmp/archive.tar.gz&quot;); QString ext = fi.suffix(); <span class="comment">// ext = &quot;gz&quot;</span></pre> <p>The suffix of a file is computed equally on all platforms, independent of file naming conventions (e.g&#x2e;, &quot;.bashrc&quot; on Unix has an empty base name, and the suffix is &quot;bashrc&quot;).</p> @see <a href="QFileInfo.html#fileName()"><tt>fileName</tt></a> @see <a href="QFileInfo.html#completeSuffix()"><tt>completeSuffix</tt></a> @see <a href="QFileInfo.html#baseName()"><tt>baseName</tt></a> @see <a href="QFileInfo.html#completeBaseName()"><tt>completeBaseName</tt></a> */"/> <method name="public final java.lang.String symLinkTarget()" doc="/** <p>Returns the absolute path to the file or directory a symlink (or shortcut on Windows) points to, or a an empty string if the object isn't a symbolic link.</p> <p>This name may not represent an existing file; it is only a string. QFileInfo::exists() returns true if the symlink points to an existing file.</p> @see <a href="QFileInfo.html#exists()"><tt>exists</tt></a> @see <a href="QFileInfo.html#isSymLink()"><tt>isSymLink</tt></a> @see <a href="QFileInfo.html#isDir()"><tt>isDir</tt></a> @see <a href="QFileInfo.html#isFile()"><tt>isFile</tt></a> */"/> </class>