📄 classpfile.html
字号:
<p>The PChannel::IsOpen()# function may be used after object construction to determine if the file was successfully opened. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>mode</em> </td><td>Name of file to open. </td></tr><tr><td valign=top><em>opts</em> </td><td>Mode in which to open the file. <a class="el" href="classPFile.html#z125_1">OpenOptions</a> enum# for open operation. </td></tr></table></dl> </td> </tr></table><a name="z125_5" doxytag="PFile::~PFile"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PFile::~PFile </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Close the file on destruction.<p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="z131_1" doxytag="PFile::Access"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PINLINE BOOL PFile::Access </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classPFile.html#z125_0">OpenMode</a> </td> <td class="mdname1" valign="top" nowrap> <em>mode</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Check for file access modes. Determine if the file path specification associated with the instance of the object may be opened in the specified mode. This would check the current access rights to the file for the mode. For example, for a file that is read only, using mode == ReadWrite would return FALSE but mode == ReadOnly would return TRUE.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if a file open would succeed. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>mode</em> </td><td>Mode in which the file open would be done. </td></tr></table></dl> </td> </tr></table><a name="z131_7" doxytag="PFile::Access"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> BOOL PFile::Access </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPFile.html#z125_0">OpenMode</a> </td> <td class="mdname" nowrap> <em>mode</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Check for file access modes. Determine if the file specified may be opened in the specified mode. This would check the current access rights to the file for the mode. For example, for a file that is read only, using mode == ReadWrite would return FALSE but mode == ReadOnly would return TRUE.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if a file open would succeed. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>mode</em> </td><td>Name of file to have its access checked. Mode in which the file open would be done. </td></tr></table></dl> </td> </tr></table><a name="z129_3" doxytag="PFile::Close"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PFile::Close </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Close the file channel. <dl compact><dt><b>Returns: </b></dt><dd>TRUE if close was OK. </dl><p>Reimplemented from <a class="el" href="classPChannel.html#z53_1">PChannel</a>.<p>Reimplemented in <a class="el" href="classPWAVFile.html#z495_4">PWAVFile</a>. </td> </tr></table><a name="z127_0" doxytag="PFile::Compare"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classPObject.html#z199_0">Comparison</a> PFile::Compare </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPObject.html">PObject</a> & </td> <td class="mdname1" valign="top" nowrap> <em>obj</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Determine the relative rank of the two objects. This is essentially the string comparison of the PFilePath# names of the files.<p><dl compact><dt><b>Returns: </b></dt><dd> relative rank of the file paths. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>obj</em> </td><td>Other file to compare against. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPChannel.html#z45_0">PChannel</a>.<p>Reimplemented in <a class="el" href="classPMemoryFile.html#z485_0">PMemoryFile</a>. </td> </tr></table><a name="z131_4" doxytag="PFile::Copy"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PINLINE BOOL PFile::Copy </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname" nowrap> <em>newname</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>BOOL </td> <td class="mdname" nowrap> <em>force</em> = FALSE</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Make a copy of the current file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was renamed. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>force</em> </td><td>New name for the file. Delete file if a destination exists with the same name. </td></tr></table></dl> </td> </tr></table><a name="z131_10" doxytag="PFile::Copy"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> BOOL PFile::Copy </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname" nowrap> <em>oldname</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname" nowrap> <em>newname</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>BOOL </td> <td class="mdname" nowrap> <em>force</em> = FALSE</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [static]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Make a copy of the specified file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was renamed. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>newname</em> </td><td>Old name of the file. </td></tr><tr><td valign=top><em>force</em> </td><td>New name for the file. Delete file if a destination exists with the same name. </td></tr></table></dl> </td> </tr></table><a name="z131_0" doxytag="PFile::Exists"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> PINLINE BOOL PFile::Exists </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -