⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classpfile.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</table><a name="z131_11" doxytag="PFile::Move"></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::Move </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>oldname</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const <a class="el" href="classPFilePath.html">PFilePath</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>newname</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>BOOL&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>force</em> = FALSE</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [static]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Move the specified file. This will move the file from one position in the directory hierarchy to another position. The actual operation is platform dependent but the reslt is the same. For instance, for Unix, if the move is within a file system then a simple rename is done, if it is across file systems then a copy and a delete is performed.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was moved. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>newname</em>&nbsp;</td><td>Old path and name of the file. </td></tr><tr><td valign=top><em>force</em>&nbsp;</td><td>New path and name for the file. Delete file if a destination exists with the same name. </td></tr></table></dl>    </td>  </tr></table><a name="z133_4" doxytag="PFile::Open"></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::Open </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>name</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classPFile.html#z125_0">OpenMode</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>mode</em> = ReadWrite, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>opts</em> = ModeDefault</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Open the specified file name in the specified mode and with the specified options. If the file object already has an open file then it is closed.<p>Note: if mode# is StandardInput, StandardOutput or StandardError, then the name# parameter is ignored.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was successfully opened. </dl><p>Reimplemented in <a class="el" href="classPWAVFile.html#z495_3">PWAVFile</a>.    </td>  </tr></table><a name="z133_3" doxytag="PFile::Open"></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::Open </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classPFile.html#z125_0">OpenMode</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>mode</em> = ReadWrite, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>opts</em> = ModeDefault</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Open the current file in the specified mode and with the specified options. If the file object already has an open file then it is closed.<p>If there has not been a filename attached to the file object (via <a class="el" href="classPFile.html#z133_2">SetFilePath()</a>#, the name# parameter or a previous open) then a new unique temporary filename is generated.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was successfully opened. </dl><p>Reimplemented in <a class="el" href="classPWAVFile.html#z495_2">PWAVFile</a>.    </td>  </tr></table><a name="z129_1" doxytag="PFile::Read"></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::Read </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>PINDEX&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>len</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Low level read from the file channel. The read timeout is ignored for file I/O. The <a class="el" href="classPChannel.html#z49_3">GetLastReadCount()</a> function returns the actual number of bytes read.<p>The <a class="el" href="classPChannel.html#z55_2">GetErrorCode()</a> function should be consulted after <a class="el" href="classPFile.html#z129_1">Read()</a> returns FALSE to determine what caused the failure.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE indicates that at least one character was read from the channel. FALSE means no bytes were read due to timeout or some other I/O error. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>len</em>&nbsp;</td><td>Pointer to a block of memory to receive the read bytes. Maximum number of bytes to read into the buffer. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPChannel.html#z49_2">PChannel</a>.<p>Reimplemented in <a class="el" href="classPMemoryFile.html#z487_0">PMemoryFile</a>, and <a class="el" href="classPWAVFile.html#z495_0">PWAVFile</a>.    </td>  </tr></table><a name="z131_2" doxytag="PFile::Remove"></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::Remove </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">BOOL&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>force</em> = FALSE          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Delete the current file. If force# is FALSE and the file is protected against being deleted then the function fails. If force# is TRUE then the protection is ignored. What constitutes file deletion protection is platform dependent, eg on DOS is the Read Only attribute and on a Novell network it is a Delete trustee right. Some protection may not be able to overridden with the force# parameter at all, eg on a Unix system and you are not the owner of the file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was deleted. </dl>    </td>  </tr></table><a name="z131_8" doxytag="PFile::Remove"></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::Remove </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>name</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>BOOL&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>force</em> = FALSE</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [static]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Delete the specified file. If force# is FALSE and the file is protected against being deleted then the function fails. If force# is TRUE then the protection is ignored. What constitutes file deletion protection is platform dependent, eg on DOS is the Read Only attribute and on a Novell network it is a Delete trustee right. Some protection may not be able to overridden with the force# parameter at all, eg on a Unix system and you are not the owner of the file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was deleted. </dl>    </td>  </tr></table><a name="z131_3" doxytag="PFile::Rename"></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::Rename </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>newname</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>BOOL&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>force</em> = FALSE</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Change the current files name. This does not move the file in the directory hierarchy, it only changes the name of the directory entry.<p>The newname# parameter must consist only of the file name part, as returned by the PFilePath::GetFileName()# function. Any other file path parts will cause an error.<p>The first form uses the file path specification associated with the instance of the object. The name within the instance is changed to the new name if the function succeeds. The second static function uses an arbitrary file specified by name.<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>&nbsp;</td><td>New name for the file. Delete file if a destination exists with the same name. </td></tr></table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -