Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1283

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/tools/qfileinfo.cpp:48 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QFileInfo Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QFileInfo Class Reference</h1>

<p>The QFileInfo class provides system-independent file information.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qfileinfo-h.html">qfileinfo.h</a>&gt;</tt>
<p><a href="qfileinfo-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn>enum <a href="#PermissionSpec-enum"><b>PermissionSpec</b></a> { ReadUser = 0400, WriteUser = 0200, ExeUser = 0100, ReadGroup = 0040, WriteGroup = 0020, ExeGroup = 0010, ReadOther = 0004, WriteOther = 0002, ExeOther = 0001 }</div></li>
<li><div class=fn><a href="#QFileInfo"><b>QFileInfo</b></a> ()</div></li>
<li><div class=fn><a href="#QFileInfo-2"><b>QFileInfo</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;file )</div></li>
<li><div class=fn><a href="#QFileInfo-3"><b>QFileInfo</b></a> ( const&nbsp;QFile&nbsp;&amp;&nbsp;file )</div></li>
<li><div class=fn><a href="#QFileInfo-4"><b>QFileInfo</b></a> ( const&nbsp;QDir&nbsp;&amp;&nbsp;d, const&nbsp;QString&nbsp;&amp;&nbsp;fileName )</div></li>
<li><div class=fn><a href="#QFileInfo-5"><b>QFileInfo</b></a> ( const&nbsp;QFileInfo&nbsp;&amp;&nbsp;fi )</div></li>
<li><div class=fn><a href="#~QFileInfo"><b>~QFileInfo</b></a> ()</div></li>
<li><div class=fn>QFileInfo &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QFileInfo&nbsp;&amp;&nbsp;fi )</div></li>
<li><div class=fn>void <a href="#setFile"><b>setFile</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;file )</div></li>
<li><div class=fn>void <a href="#setFile-2"><b>setFile</b></a> ( const&nbsp;QFile&nbsp;&amp;&nbsp;file )</div></li>
<li><div class=fn>void <a href="#setFile-3"><b>setFile</b></a> ( const&nbsp;QDir&nbsp;&amp;&nbsp;d, const&nbsp;QString&nbsp;&amp;&nbsp;fileName )</div></li>
<li><div class=fn>bool <a href="#exists"><b>exists</b></a> () const</div></li>
<li><div class=fn>void <a href="#refresh"><b>refresh</b></a> () const</div></li>
<li><div class=fn>bool <a href="#caching"><b>caching</b></a> () const</div></li>
<li><div class=fn>void <a href="#setCaching"><b>setCaching</b></a> ( bool&nbsp;enable )</div></li>
<li><div class=fn>QString <a href="#filePath"><b>filePath</b></a> () const</div></li>
<li><div class=fn>QString <a href="#fileName"><b>fileName</b></a> () const</div></li>
<li><div class=fn>QString <a href="#absFilePath"><b>absFilePath</b></a> () const</div></li>
<li><div class=fn>QString <a href="#baseName"><b>baseName</b></a> ( bool&nbsp;complete = FALSE ) const</div></li>
<li><div class=fn>QString <a href="#extension"><b>extension</b></a> ( bool&nbsp;complete = TRUE ) const</div></li>
<li><div class=fn>QString <a href="#dirPath"><b>dirPath</b></a> ( bool&nbsp;absPath = FALSE ) const</div></li>
<li><div class=fn>QDir <a href="#dir"><b>dir</b></a> ( bool&nbsp;absPath = FALSE ) const</div></li>
<li><div class=fn>bool <a href="#isReadable"><b>isReadable</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isWritable"><b>isWritable</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isExecutable"><b>isExecutable</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isRelative"><b>isRelative</b></a> () const</div></li>
<li><div class=fn>bool <a href="#convertToAbs"><b>convertToAbs</b></a> ()</div></li>
<li><div class=fn>bool <a href="#isFile"><b>isFile</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isDir"><b>isDir</b></a> () const</div></li>
<li><div class=fn>bool <a href="#isSymLink"><b>isSymLink</b></a> () const</div></li>
<li><div class=fn>QString <a href="#readLink"><b>readLink</b></a> () const</div></li>
<li><div class=fn>QString <a href="#owner"><b>owner</b></a> () const</div></li>
<li><div class=fn>uint <a href="#ownerId"><b>ownerId</b></a> () const</div></li>
<li><div class=fn>QString <a href="#group"><b>group</b></a> () const</div></li>
<li><div class=fn>uint <a href="#groupId"><b>groupId</b></a> () const</div></li>
<li><div class=fn>bool <a href="#permission"><b>permission</b></a> ( int&nbsp;permissionSpec ) const</div></li>
<li><div class=fn>uint <a href="#size"><b>size</b></a> () const</div></li>
<li><div class=fn>QDateTime <a href="#created"><b>created</b></a> () const</div></li>
<li><div class=fn>QDateTime <a href="#lastModified"><b>lastModified</b></a> () const</div></li>
<li><div class=fn>QDateTime <a href="#lastRead"><b>lastRead</b></a> () const</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QFileInfo class provides system-independent file information.
<p> 
<p> 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
symbolic link, etc. The file's size and last modified/read times are
also available.
<p> A QFileInfo can point to a file with either a relative or an
absolute file path. Absolute file paths begin with the directory
separator "/" or a drive specification (except on Unix).
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 "/tmp/quartz". A relative path might look
like "src/fatlib". You can use the function <a href="#isRelative">isRelative</a>() to check
whether a QFileInfo is using a relative or an absolute file path. You
can call the function <a href="#convertToAbs">convertToAbs</a>() to convert a relative QFileInfo's
path to an absolute path.
<p> The file that the QFileInfo works on is set in the constructor or
later with <a href="#setFile">setFile</a>(). Use <a href="#exists">exists</a>() to see if the file exists and
<a href="#size">size</a>() to get its size.
<p> To speed up performance, QFileInfo 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="#refresh">refresh</a>(). If you want to switch off a
QFileInfo's caching and force it to access the file system every time
you request information from it call <a href="#setCaching">setCaching</a>(FALSE).
<p> The file's type is obtained with <a href="#isFile">isFile</a>(), <a href="#isDir">isDir</a>() and <a href="#isSymLink">isSymLink</a>().
The <a href="#readLink">readLink</a>() function provides the name of the file the symlink
points to.
<p> Elements of the file's name can be extracted with <a href="#dirPath">dirPath</a>() and
<a href="#fileName">fileName</a>(). The fileName()'s parts can be extracted with <a href="#baseName">baseName</a>()
and <a href="#extension">extension</a>().
<p> The file's dates are returned by <a href="#created">created</a>(), <a href="#lastModified">lastModified</a>() and
<a href="#lastRead">lastRead</a>(). Information about the file's access permissions is
obtained with <a href="#isReadable">isReadable</a>(), <a href="#isWritable">isWritable</a>() and <a href="#isExecutable">isExecutable</a>(). The
file's ownership is available from <a href="#owner">owner</a>(), <a href="#ownerId">ownerId</a>(), <a href="#group">group</a>() and
<a href="#groupId">groupId</a>(). You can examine a file's permissions and ownership in a
single statement using the <a href="#permission">permission</a>() function.
<p> If you need to read and traverse directories, see the <a href="qdir.html">QDir</a> class.
<p>See also <a href="io.html">Input/Output and Networking</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="PermissionSpec-enum"></a>QFileInfo::PermissionSpec</h3>

<p> This enum is used by the <a href="#permission">permission</a>() function to report the
permissions and ownership of a file. The values may be OR-ed
together to test multiple permissions and ownership values.
<ul>
<li><tt>QFileInfo::ReadUser</tt> - The file is readable by the user.
<li><tt>QFileInfo::WriteUser</tt> - The file is writable by the user.
<li><tt>QFileInfo::ExeUser</tt> - The file is executable by the user.
<li><tt>QFileInfo::ReadGroup</tt> - The file is readable by the group.
<li><tt>QFileInfo::WriteGroup</tt> - The file is writable by the group.
<li><tt>QFileInfo::ExeGroup</tt> - The file is executable by the group.
<li><tt>QFileInfo::ReadOther</tt> - The file is readable by anyone.
<li><tt>QFileInfo::WriteOther</tt> - The file is writable by anyone.
<li><tt>QFileInfo::ExeOther</tt> - The file is executable by anyone.
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QFileInfo"></a>QFileInfo::QFileInfo ()
</h3>
Constructs a new empty QFileInfo.

<h3 class=fn><a name="QFileInfo-2"></a>QFileInfo::QFileInfo ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;file )
</h3>
Constructs a new QFileInfo that gives information about the given file.
The <em>file</em> can be an absolute or a relative file path.
<p> <p>See also <a href="#setFile">setFile</a>(), <a href="#isRelative">isRelative</a>(), <a href="qdir.html#setCurrent">QDir::setCurrent</a>() and <a href="qdir.html#isRelativePath">QDir::isRelativePath</a>().

<h3 class=fn><a name="QFileInfo-3"></a>QFileInfo::QFileInfo ( const&nbsp;<a href="qfile.html">QFile</a>&nbsp;&amp;&nbsp;file )
</h3>
Constructs a new QFileInfo that gives information about file <em>file</em>.
<p> If the <em>file</em> has a relative path, the QFileInfo will also have a
relative path.
<p> <p>See also <a href="#isRelative">isRelative</a>().

<h3 class=fn><a name="QFileInfo-4"></a>QFileInfo::QFileInfo ( const&nbsp;<a href="qdir.html">QDir</a>&nbsp;&amp;&nbsp;d, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName )
</h3>
Constructs a new QFileInfo that gives information about the file
named <em>fileName</em> in the directory <em>d</em>.
<p> If the directory has a relative path, the QFileInfo will also have a
relative path.
<p> <p>See also <a href="#isRelative">isRelative</a>().

<h3 class=fn><a name="QFileInfo-5"></a>QFileInfo::QFileInfo ( const&nbsp;<a href="qfileinfo.html">QFileInfo</a>&nbsp;&amp;&nbsp;fi )
</h3>
Constructs a new QFileInfo that is a copy of <em>fi</em>.

<h3 class=fn><a name="~QFileInfo"></a>QFileInfo::~QFileInfo ()
</h3>
Destroys the QFileInfo and frees its resources.

<h3 class=fn><a href="qstring.html">QString</a> <a name="absFilePath"></a>QFileInfo::absFilePath () const
</h3>
Returns the absolute path including the file name.
<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> This function returns the same as <a href="#filePath">filePath</a>(), unless <a href="#isRelative">isRelative</a>() is
TRUE.
<p> This function can be time consuming under Unix (in the order of
milliseconds).
<p> <p>See also <a href="#isRelative">isRelative</a>() and <a href="#filePath">filePath</a>().

<p>Examples: <a href="biff-example.html#x1901">biff/biff.cpp</a> and <a href="fileiconview-example.html#x1533">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="baseName"></a>QFileInfo::baseName ( bool&nbsp;complete = FALSE ) const
</h3>
Returns the base name of the file.
<p> If <em>complete</em> is FALSE (the default) the base name consists of all
characters in the file name up to (but not including) the <em>first</em> '.'
character.
<p> If <em>complete</em> is TRUE the base name consists of all characters in the
file up to (but not including) the <em>last</em> '.' character.
<p> The path is not included in either case.
<p> Example:
<pre>
     QFileInfo fi( "/tmp/archive.tar.gz" );
     <a href="qstring.html">QString</a> base = fi.<a href="#baseName">baseName</a>();  // base = "archive"
     base = fi.<a href="#baseName">baseName</a>( TRUE );    // base = "archive.tar"
  </pre>
 
<p> <p>See also <a href="#fileName">fileName</a>() and <a href="#extension">extension</a>().

<h3 class=fn>bool <a name="caching"></a>QFileInfo::caching () const
</h3>

Returns TRUE if caching is enabled; otherwise returns FALSE.
<p>See also <a href="#setCaching">setCaching</a>() and <a href="#refresh">refresh</a>().

<h3 class=fn>bool <a name="convertToAbs"></a>QFileInfo::convertToAbs ()
</h3>
Converts the file path name to an absolute path.
<p> If it is already absolute, nothing is done.
<p> <p>See also <a href="#filePath">filePath</a>() and <a href="#isRelative">isRelative</a>().

<h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="created"></a>QFileInfo::created () const
</h3>
Returns the date and time when the file was created.
<p> On platforms where this information is not available, returns the
same as <a href="#lastModified">lastModified</a>().
<p> <p>See also <a href="#lastModified">lastModified</a>() and <a href="#lastRead">lastRead</a>().

<h3 class=fn><a href="qdir.html">QDir</a> <a name="dir"></a>QFileInfo::dir ( bool&nbsp;absPath = FALSE ) const
</h3>
Returns the directory path of the file.
<p> If the QFileInfo is relative and <em>absPath</em> is FALSE, the <a href="qdir.html">QDir</a> will be
relative; otherwise it will be absolute.
<p> <p>See also <a href="#dirPath">dirPath</a>(), <a href="#filePath">filePath</a>(), <a href="#fileName">fileName</a>() and <a href="#isRelative">isRelative</a>().

<p>Example: <a href="fileiconview-example.html#x1534">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="dirPath"></a>QFileInfo::dirPath ( bool&nbsp;absPath = FALSE ) const
</h3>
Returns the directory path of the file.
<p> If <em>absPath</em> is TRUE an absolute path is returned.
<p> <p>See also <a href="#dir">dir</a>(), <a href="#filePath">filePath</a>(), <a href="#fileName">fileName</a>() and <a href="#isRelative">isRelative</a>().

<p>Example: <a href="fileiconview-example.html#x1535">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>bool <a name="exists"></a>QFileInfo::exists () const
</h3>
Returns TRUE if the file exists; otherwise returns FALSE.

<p>Examples: <a href="biff-example.html#x1902">biff/biff.cpp</a> and <a href="i18n-example.html#x1372">i18n/main.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="extension"></a>QFileInfo::extension ( bool&nbsp;complete = TRUE ) const
</h3>
Returns the file's extension name.
<p> If <em>complete</em> is TRUE (the default), <a href="#extension">extension</a>() returns the string
of all characters in the file name after (but not including) the
first '.'  character.
<p> If <em>complete</em> is FALSE, extension() returns the string of all
characters in the file name after (but not including) the last '.'
character.
<p> Example:
<pre>
     QFileInfo fi( "/tmp/archive.tar.gz" );
     <a href="qstring.html">QString</a> ext = fi.<a href="#extension">extension</a>();  // ext = "tar.gz"
     ext = fi.<a href="#extension">extension</a>( FALSE );   // ext = "gz"
  </pre>
 
<p> <p>See also <a href="#fileName">fileName</a>() and <a href="#baseName">baseName</a>().

<p> 
<p>Example: <a href="qdir-example.html#x781">qdir/qdir.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="fileName"></a>QFileInfo::fileName () const
</h3>
Returns the name of the file, the file path is not included.
<p> Example:
<pre>
     QFileInfo fi( "/tmp/archive.tar.gz" );
     <a href="qstring.html">QString</a> name = fi.<a href="#fileName">fileName</a>();              // name = "archive.tar.gz"
  </pre>
 
<p> <p>See also <a href="#isRelative">isRelative</a>(), <a href="#filePath">filePath</a>(), <a href="#baseName">baseName</a>() and <a href="#extension">extension</a>().

<p>Examples: <a href="dirview-example.html#x1672">dirview/dirview.cpp</a> and <a href="fileiconview-example.html#x1536">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="filePath"></a>QFileInfo::filePath () const
</h3>
Returns the file name, including the path (which may be absolute or
relative).
<p> <p>See also <a href="#isRelative">isRelative</a>() and <a href="#absFilePath">absFilePath</a>().

<p>Examples: <a href="dirview-example.html#x1708">dirview/main.cpp</a> and <a href="fileiconview-example.html#x1537">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="group"></a>QFileInfo::group () const
</h3>
Returns the group of the file. On Windows, on systems where files do
not have groups, or if an error occurs, a null string is returned. 
<p> This function can be time consuming under Unix (in the order of
milliseconds).
<p> <p>See also <a href="#groupId">groupId</a>(), <a href="#owner">owner</a>() and <a href="#ownerId">ownerId</a>().

<h3 class=fn>uint <a name="groupId"></a>QFileInfo::groupId () const
</h3>
Returns the id of the group the file belongs to.
<p> On Windows and on systems where files do not have groups this function
always returns (uint) -2.
<p> <p>See also <a href="#group">group</a>(), <a href="#owner">owner</a>() and <a href="#ownerId">ownerId</a>().

<h3 class=fn>bool <a name="isDir"></a>QFileInfo::isDir () const
</h3>
Returns TRUE if this object points to a directory or to a symbolic
link to a directory; otherwise returns FALSE.
<p>See also <a href="#isFile">isFile</a>() and <a href="#isSymLink">isSymLink</a>().

<p>Examples: <a href="dirview-example.html#x1673">dirview/dirview.cpp</a> and <a href="fileiconview-example.html#x1538">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>bool <a name="isExecutable"></a>QFileInfo::isExecutable () const
</h3>
Returns TRUE if the file is executable; otherwise returns FALSE.
<p>See also <a href="#isReadable">isReadable</a>(), <a href="#isWritable">isWritable</a>() and <a href="#permission">permission</a>().

<h3 class=fn>bool <a name="isFile"></a>QFileInfo::isFile () const
</h3>
Returns TRUE if this object points to a file. Returns FALSE if the
object points to something which isn't a file, e.g. a directory or a
symlink.
<p> <p>See also <a href="#isDir">isDir</a>() and <a href="#isSymLink">isSymLink</a>().

<p>Examples: <a href="dirview-example.html#x1674">dirview/dirview.cpp</a>, <a href="fileiconview-example.html#x1539">fileiconview/qfileiconview.cpp</a> and <a href="qdir-example.html#x782">qdir/qdir.cpp</a>.
<h3 class=fn>bool <a name="isReadable"></a>QFileInfo::isReadable () const
</h3>
Returns TRUE if the file is readable; otherwise returns FALSE.
<p>See also <a href="#isWritable">isWritable</a>(), <a href="#isExecutable">isExecutable</a>() and <a href="#permission">permission</a>().

<h3 class=fn>bool <a name="isRelative"></a>QFileInfo::isRelative () const
</h3>
Returns TRUE if the file path name is relative. Returns FALSE if the
path is absolute (e.g. under Unix a path is absolute if it
begins with a "/").

<h3 class=fn>bool <a name="isSymLink"></a>QFileInfo::isSymLink () const
</h3>
Returns TRUE if this object points to a symbolic link (or to a
shortcut on Windows); otherwise returns FALSE. 
<p> <p>See also <a href="#isFile">isFile</a>(), <a href="#isDir">isDir</a>() and <a href="#readLink">readLink</a>().

<p>Examples: <a href="dirview-example.html#x1675">dirview/dirview.cpp</a> and <a href="fileiconview-example.html#x1540">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>bool <a name="isWritable"></a>QFileInfo::isWritable () const
</h3>
Returns TRUE if the file is writable; otherwise returns FALSE.
<p>See also <a href="#isReadable">isReadable</a>(), <a href="#isExecutable">isExecutable</a>() and <a href="#permission">permission</a>().

<h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="lastModified"></a>QFileInfo::lastModified () const
</h3>
Returns the date and time when the file was last modified.
<p> <p>See also <a href="#created">created</a>() and <a href="#lastRead">lastRead</a>().

<p>Example: <a href="biff-example.html#x1903">biff/biff.cpp</a>.
<h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="lastRead"></a>QFileInfo::lastRead () const
</h3>
Returns the date and time when the file was last read (accessed).
<p> On platforms where this information is not available, returns the
same as <a href="#lastModified">lastModified</a>().
<p> <p>See also <a href="#created">created</a>() and <a href="#lastModified">lastModified</a>().

<p>Example: <a href="biff-example.html#x1904">biff/biff.cpp</a>.
<h3 class=fn><a href="qfileinfo.html">QFileInfo</a>&nbsp;&amp; <a name="operator-eq"></a>QFileInfo::operator= ( const&nbsp;<a href="qfileinfo.html">QFileInfo</a>&nbsp;&amp;&nbsp;fi )
</h3>
Makes a copy of <em>fi</em> and assigns it to this QFileInfo.

<h3 class=fn><a href="qstring.html">QString</a> <a name="owner"></a>QFileInfo::owner () const
</h3>
Returns the owner of the file. On Windows, on systems where files do
not have owners, or if an error occurs, a null string is returned. 
<p> This function can be time consuming under Unix (in the order of
milliseconds).
<p> <p>See also <a href="#ownerId">ownerId</a>(), <a href="#group">group</a>() and <a href="#groupId">groupId</a>().

<h3 class=fn>uint <a name="ownerId"></a>QFileInfo::ownerId () const
</h3>
Returns the id of the owner of the file.
<p> On Windows and on systems where files do not have owners this function
returns ((uint) -2).
<p> <p>See also <a href="#owner">owner</a>(), <a href="#group">group</a>() and <a href="#groupId">groupId</a>().

<h3 class=fn>bool <a name="permission"></a>QFileInfo::permission ( int&nbsp;permissionSpec ) const
</h3>

<p> Tests for file permissions.  The <em>permissionSpec</em> argument can be several
flags of type PermissionSpec OR-ed together to check for permission
combinations.
<p> On systems where files do not have permissions this function always
returns TRUE.
<p> Example:
<pre>
    QFileInfo fi( "/tmp/archive.tar.gz" );
    if ( fi.<a href="#permission">permission</a>( QFileInfo::<a href="#PermissionSpec-enum">WriteUser</a> | QFileInfo::<a href="#PermissionSpec-enum">ReadGroup</a> ) )
        <a href="qapplication.html#qWarning">qWarning</a>( "I can change the file; my group can read the file.");
    if ( fi.<a href="#permission">permission</a>( QFileInfo::<a href="#PermissionSpec-enum">WriteGroup</a> | QFileInfo::<a href="#PermissionSpec-enum">WriteOther</a> ) )
        <a href="qapplication.html#qWarning">qWarning</a>( "The group or others can change the file!" );
  </pre>
 
<p> <p>See also <a href="#isReadable">isReadable</a>(), <a href="#isWritable">isWritable</a>() and <a href="#isExecutable">isExecutable</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="readLink"></a>QFileInfo::readLink () const
</h3>
Returns the name a symlink (or shortcut on Windows) points to, or a
null <a href="qstring.html">QString</a> if the object isn't a symbolic link.
<p> This name may not represent an existing file; it is only a string.
<a href="#exists">QFileInfo::exists</a>() returns TRUE if the symlink points to an
existing file.
<p> <p>See also <a href="#exists">exists</a>(), <a href="#isSymLink">isSymLink</a>(), <a href="#isDir">isDir</a>() and <a href="#isFile">isFile</a>().

<h3 class=fn>void <a name="refresh"></a>QFileInfo::refresh () const
</h3>
Refreshes the information about the file, i.e. reads in information
from the file system the next time a cached property is fetched.
<p> <p>See also <a href="#setCaching">setCaching</a>().

<h3 class=fn>void <a name="setCaching"></a>QFileInfo::setCaching ( bool&nbsp;enable )
</h3>
If <em>enable</em> is TRUE, enables caching of file information. If <em>enable</em> is FALSE caching is disabled.
<p> When caching is enabled, QFileInfo reads the file information from the
file system the first time it's needed, but generally not later.
<p> Caching is enabled by default.
<p> <p>See also <a href="#refresh">refresh</a>() and <a href="#caching">caching</a>().

<h3 class=fn>void <a name="setFile"></a>QFileInfo::setFile ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;file )
</h3>
Sets the file that the QFileInfo provides information about to <em>file</em>.
<p> The string given can be an absolute or a relative file path. Absolute
paths begin with the directory separator (e.g. "/" under Unix) 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.
<p> Example:
<pre>
    <a href="qstring.html">QString</a> absolute = "/local/bin";
    <a href="qstring.html">QString</a> relative = "local/bin";
    QFileInfo absFile( absolute );
    QFileInfo relFile( relative );

    QDir::<a href="qdir.html#setCurrent">setCurrent</a>( QDir::<a href="qdir.html#rootDirPath">rootDirPath</a>() );
    // absFile and relFile now point to the same file

    QDir::<a href="qdir.html#setCurrent">setCurrent</a>( "/tmp" );
    // absFile now points to "/local/bin",
    // while relFile points to "/tmp/local/bin"
  </pre>
 
<p> <p>See also <a href="#isRelative">isRelative</a>(), <a href="qdir.html#setCurrent">QDir::setCurrent</a>() and <a href="qdir.html#isRelativePath">QDir::isRelativePath</a>().

<p>Example: <a href="biff-example.html#x1905">biff/biff.cpp</a>.
<h3 class=fn>void <a name="setFile-2"></a>QFileInfo::setFile ( const&nbsp;<a href="qfile.html">QFile</a>&nbsp;&amp;&nbsp;file )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the file that the QFileInfo provides information about to <em>file</em>.
<p> If the file has a relative path, the QFileInfo will also have a
relative path.
<p> <p>See also <a href="#isRelative">isRelative</a>().

<h3 class=fn>void <a name="setFile-3"></a>QFileInfo::setFile ( const&nbsp;<a href="qdir.html">QDir</a>&nbsp;&amp;&nbsp;d, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;fileName )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the file that the QFileInfo provides information about to <em>fileName</em> in directory <em>d</em>.
<p> If the file has a relative path, the QFileInfo will also have a
relative path.
<p> <p>See also <a href="#isRelative">isRelative</a>().

<h3 class=fn>uint <a name="size"></a>QFileInfo::size () const
</h3>
Returns the file size in bytes, or 0 if the file does not exist or if
the size is 0 or if the size cannot be fetched.

<p>Example: <a href="qdir-example.html#x783">qdir/qdir.cpp</a>.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>