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

📄 classpfile.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</dl>    </td>  </tr></table><a name="z131_9" 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="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="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"><code> [static]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Change the specified 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>newname</em>&nbsp;</td><td>Old name of the file. </td></tr><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></dl>    </td>  </tr></table><a name="z133_2" doxytag="PFile::SetFilePath"></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"> void PFile::SetFilePath </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="mdname1" valign="top" nowrap>&nbsp; <em>path</em>          </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>Set the full path name of the file. The PFilePath# object describes the full file name specification for the particular platform. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>path</em>&nbsp;</td><td>New file path. </td></tr></table></dl>    </td>  </tr></table><a name="z133_6" doxytag="PFile::SetLength"></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::SetLength </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">off_t&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>len</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Set the size of the file, padding with 0 bytes if it would require expanding the file, or truncating it if being made shorter.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file size was changed to the length specified. </dl><p>Reimplemented in <a class="el" href="classPMemoryFile.html#z489_1">PMemoryFile</a>.    </td>  </tr></table><a name="z133_11" doxytag="PFile::SetPermissions"></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::SetPermissions </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>permissions</em>          </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>Set permissions on the current file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was renamed. </dl>    </td>  </tr></table><a name="z133_13" doxytag="PFile::SetPermissions"></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::SetPermissions </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>int&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>permissions</em></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>Set permissions on the specified file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the file was renamed. </dl>    </td>  </tr></table><a name="z133_7" doxytag="PFile::SetPosition"></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::SetPosition </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">off_t&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>pos</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classPFile.html#z133_0">FilePositionOrigin</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>origin</em> = Start</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>Set the current active position in the file for the next read or write operation. The pos# variable is a signed number which is added to the specified origin. For origin == <a class="el" href="classPFile.html#z133_0s11">PFile::Start</a># only positive values for pos# are meaningful. For origin == <a class="el" href="classPFile.html#z133_0s13">PFile::End</a># only negative values for pos# are meaningful.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the new file position was set. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>origin</em>&nbsp;</td><td>New position to set. Origin for position change. </td></tr></table></dl><p>Reimplemented in <a class="el" href="classPMemoryFile.html#z489_2">PMemoryFile</a>, and <a class="el" href="classPWAVFile.html#z495_5">PWAVFile</a>.    </td>  </tr></table><a name="z129_2" doxytag="PFile::Write"></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::Write </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const 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 write to the file channel. The write timeout is ignored for file I/O. The <a class="el" href="classPChannel.html#z51_3">GetLastWriteCount()</a> function returns the actual number of bytes written.<p>The <a class="el" href="classPChannel.html#z55_2">GetErrorCode()</a> function should be consulted after <a class="el" href="classPFile.html#z129_2">Write()</a> returns FALSE to determine what caused the failure.<p><dl compact><dt><b>Returns: </b></dt><dd>TRUE if at least len bytes were written to the channel. </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 write. Number of bytes to write. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPChannel.html#z51_2">PChannel</a>.<p>Reimplemented in <a class="el" href="classPMemoryFile.html#z487_1">PMemoryFile</a>, and <a class="el" href="classPWAVFile.html#z495_1">PWAVFile</a>.    </td>  </tr></table><hr><h2>Member Data Documentation</h2><a name="n0" doxytag="PFile::path"></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="classPFilePath.html">PFilePath</a> PFile::path<code> [protected]</code>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>The fully qualifi

⌨️ 快捷键说明

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