Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 7fd7c575020aa78a8e2e309ea8909f43 > files > 841

gdal-1.6.2-6.fc13.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OGR: cpl_vsi.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_9403295bfc17f2c2ba80cf17b83e4de3.html">port</a>
  </div>
</div>
<div class="contents">
<h1>cpl_vsi.h File Reference</h1><code>#include &quot;<a class="el" href="cpl__port_8h_source.html">cpl_port.h</a>&quot;</code><br/>
<code>#include &lt;unistd.h&gt;</code><br/>
<code>#include &lt;sys/stat.h&gt;</code><br/>

<p><a href="cpl__vsi_8h_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">FILE *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL</a> (const char *, const char *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open file.  <a href="#a48b5fab6cc22a9d0a543c095ee358634"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#ab1fc5cbfff98db8f5aa912606b07e8d9">VSIFCloseL</a> (FILE *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close file.  <a href="#ab1fc5cbfff98db8f5aa912606b07e8d9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#ae4fbf582f429d575cd06d559afb0ce5a">VSIFSeekL</a> (FILE *, vsi_l_offset, int)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Seek to requested offset.  <a href="#ae4fbf582f429d575cd06d559afb0ce5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">vsi_l_offset&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a8e02ad6d2abd844a57a206e3ebba50b4">VSIFTellL</a> (FILE *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tell current file offset.  <a href="#a8e02ad6d2abd844a57a206e3ebba50b4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a64335c9b9395cf8b40273a9cce4b46bf">VSIFReadL</a> (void *, size_t, size_t, FILE *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read bytes from file.  <a href="#a64335c9b9395cf8b40273a9cce4b46bf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a485b2abb8535e77a9ee2bef266a4442d">VSIFWriteL</a> (const void *, size_t, size_t, FILE *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write bytes to file.  <a href="#a485b2abb8535e77a9ee2bef266a4442d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a9e4f504264ad821b81bd26744a9c291f">VSIFEofL</a> (FILE *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test for end of file.  <a href="#a9e4f504264ad821b81bd26744a9c291f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a1e43bee7439e2da7f59bfa8c4d9ff473">VSIFFlushL</a> (FILE *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flush pending writes to disk.  <a href="#a1e43bee7439e2da7f59bfa8c4d9ff473"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a107cd7ff7361e010e21241d783b510dd">VSIFPrintfL</a> (FILE *, const char *,...)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Formatted write to file.  <a href="#a107cd7ff7361e010e21241d783b510dd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#ac92fbd5e6fc143b026001b32c4c19ed1">VSIStatL</a> (const char *, VSIStatBufL *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get filesystem object info.  <a href="#ac92fbd5e6fc143b026001b32c4c19ed1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a9b88331b0be4f7f2bd43e7b830af7038">VSIMalloc2</a> (size_t nSize1, size_t nSize2)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a644254757e7d9ec23df256d34fff565d">VSIMalloc3</a> (size_t nSize1, size_t nSize2, size_t nSize3)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char **&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a6158d73485d6cf92c75b38e7f26d00c3">VSIReadDir</a> (const char *)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read names in a directory.  <a href="#a6158d73485d6cf92c75b38e7f26d00c3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#aef0a5243bbc47cf9645a135d0c7d26df">VSIMkdir</a> (const char *pathname, long mode)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a directory.  <a href="#aef0a5243bbc47cf9645a135d0c7d26df"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a763cceaa0966f37b71a0185c92bb3ad8">VSIRmdir</a> (const char *pathname)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete a directory.  <a href="#a763cceaa0966f37b71a0185c92bb3ad8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a69dad1bd6f1af9935c1523db0c6c212f">VSIUnlink</a> (const char *pathname)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete a file.  <a href="#a69dad1bd6f1af9935c1523db0c6c212f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a26cae93b5a32e11bef9ec7c118f8cca4">VSIRename</a> (const char *oldpath, const char *newpath)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Rename a file.  <a href="#a26cae93b5a32e11bef9ec7c118f8cca4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a66e2e6f093fd42f8a941b962d4c8a19e">VSIInstallMemFileHandler</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Install "memory" file system handler.  <a href="#a66e2e6f093fd42f8a941b962d4c8a19e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a3cde09f204df6f417653b7af4761178e">VSIInstallGZipFileHandler</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Install GZip file system handler.  <a href="#a3cde09f204df6f417653b7af4761178e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a884fac3cd6be2c09deb807e959d78b3a">VSIInstallZipFileHandler</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Install ZIP file system handler.  <a href="#a884fac3cd6be2c09deb807e959d78b3a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">FILE *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#a1ecb3a78729ecea4d2ce22065a605244">VSIFileFromMemBuffer</a> (const char *pszFilename, GByte *pabyData, vsi_l_offset nDataLength, int bTakeOwnership)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create memory "file" from a buffer.  <a href="#a1ecb3a78729ecea4d2ce22065a605244"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">GByte *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="cpl__vsi_8h.html#aeaf26bcc4a5314371f426bb2a5e6ce7a">VSIGetMemFileBuffer</a> (const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Fetch buffer underlying memory file.  <a href="#aeaf26bcc4a5314371f426bb2a5e6ce7a"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Standard C Covers</p>
<p>The VSI functions are intended to be hookable aliases for Standard C I/O, memory allocation and other system functions. They are intended to allow virtualization of disk I/O so that non file data sources can be made to appear as files, and so that additional error trapping and reporting can be interested. The memory access API is aliased so that special application memory management services can be used.</p>
<p>Is is intended that each of these functions retains exactly the same calling pattern as the original Standard C functions they relate to. This means we don't have to provide custom documentation, and also means that the default implementation is very simple. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ab1fc5cbfff98db8f5aa912606b07e8d9"></a><!-- doxytag: member="cpl_vsi.h::VSIFCloseL" ref="ab1fc5cbfff98db8f5aa912606b07e8d9" args="(FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIFCloseL </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Close file. </p>
<p>This function closes the indicated file.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX fclose() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on failure. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00301">VSIFCloseL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__conv_8cpp_source.html#l01797">CPLCloseShared()</a>, <a class="el" href="cpl__minixml_8cpp_source.html#l01713">CPLParseXMLFile()</a>, <a class="el" href="cpl__minixml_8cpp_source.html#l01783">CPLSerializeXMLTreeToFile()</a>, <a class="el" href="cpl__string_8cpp_source.html#l00288">CSLLoad()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00301">VSIFCloseL()</a>.</p>

</div>
</div>
<a class="anchor" id="a9e4f504264ad821b81bd26744a9c291f"></a><!-- doxytag: member="cpl_vsi.h::VSIFEofL" ref="a9e4f504264ad821b81bd26744a9c291f" args="(FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIFEofL </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test for end of file. </p>
<p>Returns TRUE (non-zero) if the file read/write offset is currently at the end of the file.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX feof() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if at EOF else FALSE. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00491">VSIFEofL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__string_8cpp_source.html#l00288">CSLLoad()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00491">VSIFEofL()</a>.</p>

</div>
</div>
<a class="anchor" id="a1e43bee7439e2da7f59bfa8c4d9ff473"></a><!-- doxytag: member="cpl_vsi.h::VSIFFlushL" ref="a1e43bee7439e2da7f59bfa8c4d9ff473" args="(FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIFFlushL </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Flush pending writes to disk. </p>
<p>For files in write or update mode and on filesystem types where it is applicable, all pending output on the file is flushed to the physical disk.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX fflush() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00399">VSIFFlushL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil_8cpp_source.html#l00399">VSIFFlushL()</a>.</p>

</div>
</div>
<a class="anchor" id="a1ecb3a78729ecea4d2ce22065a605244"></a><!-- doxytag: member="cpl_vsi.h::VSIFileFromMemBuffer" ref="a1ecb3a78729ecea4d2ce22065a605244" args="(const char *pszFilename, GByte *pabyData, vsi_l_offset nDataLength, int bTakeOwnership)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FILE* VSIFileFromMemBuffer </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszFilename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">GByte *&nbsp;</td>
          <td class="paramname"> <em>pabyData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vsi_l_offset&nbsp;</td>
          <td class="paramname"> <em>nDataLength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>bTakeOwnership</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create memory "file" from a buffer. </p>
<p>A virtual memory file is created from the passed buffer with the indicated filename. Under normal conditions the filename would need to be absolute and within the /vsimem/ portion of the filesystem.</p>
<p>If bTakeOwnership is TRUE, then the memory file system handler will take ownership of the buffer, freeing it when the file is deleted. Otherwise it remains the responsibility of the caller, but should not be freed as long as it might be accessed as a file. In no circumstances does this function take a copy of the pabyData contents.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszFilename</em>&nbsp;</td><td>the filename to be created. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pabyData</em>&nbsp;</td><td>the data buffer for the file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nDataLength</em>&nbsp;</td><td>the length of buffer in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bTakeOwnership</em>&nbsp;</td><td>TRUE to transfer "ownership" of buffer or FALSE.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>open file handle on created file (see <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>). </dd></dl>

<p>References <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00722">VSIFileFromMemBuffer()</a>, and <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00692">VSIInstallMemFileHandler()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00722">VSIFileFromMemBuffer()</a>.</p>

</div>
</div>
<a class="anchor" id="a48b5fab6cc22a9d0a543c095ee358634"></a><!-- doxytag: member="cpl_vsi.h::VSIFOpenL" ref="a48b5fab6cc22a9d0a543c095ee358634" args="(const char *, const char *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FILE* VSIFOpenL </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszFilename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszAccess</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Open file. </p>
<p>This function opens a file with the desired access. Large files (larger than 2GB) should be supported. Binary access is always implied and the "b" does not need to be included in the pszAccess string.</p>
<p>Note that the "FILE *" returned by this function is not really a standard C library FILE *, and cannot be used with any functions other than the "VSI*L" family of functions. They aren't "real" FILE objects.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX fopen() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszFilename</em>&nbsp;</td><td>the file to open. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pszAccess</em>&nbsp;</td><td>access requested (ie. "r", "r+", "w".</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NULL on failure, or the file handle. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00273">VSIFOpenL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__conv_8cpp_source.html#l01728">CPLOpenShared()</a>, <a class="el" href="cpl__minixml_8cpp_source.html#l01713">CPLParseXMLFile()</a>, <a class="el" href="cpl__minixml_8cpp_source.html#l01783">CPLSerializeXMLTreeToFile()</a>, <a class="el" href="cpl__string_8cpp_source.html#l00288">CSLLoad()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00273">VSIFOpenL()</a>.</p>

</div>
</div>
<a class="anchor" id="a107cd7ff7361e010e21241d783b510dd"></a><!-- doxytag: member="cpl_vsi.h::VSIFPrintfL" ref="a107cd7ff7361e010e21241d783b510dd" args="(FILE *, const char *,...)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIFPrintfL </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszFormat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&nbsp;</td>
          <td class="paramname"> <em>...</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Formatted write to file. </p>
<p>Provides fprintf() style formatted output to a VSI*L file. This formats an internal buffer which is written using <a class="el" href="cpl__vsi_8h.html#a485b2abb8535e77a9ee2bef266a4442d" title="Write bytes to file.">VSIFWriteL()</a>.</p>
<p>Analog of the POSIX fprintf() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pszFormat</em>&nbsp;</td><td>the printf style format string.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of bytes written or -1 on an error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00517">VSIFPrintfL()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00463">VSIFWriteL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil_8cpp_source.html#l00517">VSIFPrintfL()</a>.</p>

</div>
</div>
<a class="anchor" id="a64335c9b9395cf8b40273a9cce4b46bf"></a><!-- doxytag: member="cpl_vsi.h::VSIFReadL" ref="a64335c9b9395cf8b40273a9cce4b46bf" args="(void *, size_t, size_t, FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t VSIFReadL </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>pBuffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read bytes from file. </p>
<p>Reads nCount objects of nSize bytes from the indicated file at the current offset into the indicated buffer.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX fread() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pBuffer</em>&nbsp;</td><td>the buffer into which the data should be read (at least nCount * nSize bytes in size. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nSize</em>&nbsp;</td><td>size of objects to read in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nCount</em>&nbsp;</td><td>number of objects to read. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of objects successfully read. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00431">VSIFReadL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__minixml_8cpp_source.html#l01713">CPLParseXMLFile()</a>, <a class="el" href="cpl__conv_8cpp_source.html#l00537">CPLReadLineL()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00431">VSIFReadL()</a>.</p>

</div>
</div>
<a class="anchor" id="ae4fbf582f429d575cd06d559afb0ce5a"></a><!-- doxytag: member="cpl_vsi.h::VSIFSeekL" ref="ae4fbf582f429d575cd06d559afb0ce5a" args="(FILE *, vsi_l_offset, int)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIFSeekL </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vsi_l_offset&nbsp;</td>
          <td class="paramname"> <em>nOffset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>nWhence</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Seek to requested offset. </p>
<p>Seek to the desired offset (nOffset) in the indicated file.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX fseek() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nOffset</em>&nbsp;</td><td>offset in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nWhence</em>&nbsp;</td><td>one of SEEK_SET, SEEK_CUR or SEEK_END.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 one failure. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00333">VSIFSeekL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__minixml_8cpp_source.html#l01713">CPLParseXMLFile()</a>, <a class="el" href="cpl__conv_8cpp_source.html#l00537">CPLReadLineL()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00333">VSIFSeekL()</a>.</p>

</div>
</div>
<a class="anchor" id="a8e02ad6d2abd844a57a206e3ebba50b4"></a><!-- doxytag: member="cpl_vsi.h::VSIFTellL" ref="a8e02ad6d2abd844a57a206e3ebba50b4" args="(FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vsi_l_offset VSIFTellL </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tell current file offset. </p>
<p>Returns the current file read/write offset in bytes from the beginning of the file.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX ftell() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>file offset in bytes. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00361">VSIFTellL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__minixml_8cpp_source.html#l01713">CPLParseXMLFile()</a>, <a class="el" href="cpl__conv_8cpp_source.html#l00537">CPLReadLineL()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00361">VSIFTellL()</a>.</p>

</div>
</div>
<a class="anchor" id="a485b2abb8535e77a9ee2bef266a4442d"></a><!-- doxytag: member="cpl_vsi.h::VSIFWriteL" ref="a485b2abb8535e77a9ee2bef266a4442d" args="(const void *, size_t, size_t, FILE *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t VSIFWriteL </td>
          <td>(</td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>pBuffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write bytes to file. </p>
<p>Writess nCount objects of nSize bytes to the indicated file at the current offset into the indicated buffer.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX fwrite() call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pBuffer</em>&nbsp;</td><td>the buffer from which the data should be written (at least nCount * nSize bytes in size. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nSize</em>&nbsp;</td><td>size of objects to read in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nCount</em>&nbsp;</td><td>number of objects to read. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of objects successfully written. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00463">VSIFWriteL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__minixml_8cpp_source.html#l01783">CPLSerializeXMLTreeToFile()</a>, <a class="el" href="cpl__vsil_8cpp_source.html#l00517">VSIFPrintfL()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00463">VSIFWriteL()</a>.</p>

</div>
</div>
<a class="anchor" id="aeaf26bcc4a5314371f426bb2a5e6ce7a"></a><!-- doxytag: member="cpl_vsi.h::VSIGetMemFileBuffer" ref="aeaf26bcc4a5314371f426bb2a5e6ce7a" args="(const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">GByte* VSIGetMemFileBuffer </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszFilename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vsi_l_offset *&nbsp;</td>
          <td class="paramname"> <em>pnDataLength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>bUnlinkAndSeize</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Fetch buffer underlying memory file. </p>
<p>This function returns a pointer to the memory buffer underlying a virtual "in memory" file. If bUnlinkAndSeize is TRUE the filesystem object will be deleted, and ownership of the buffer will pass to the caller otherwise the underlying file will remain in existance.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszFilename</em>&nbsp;</td><td>the name of the file to grab the buffer of. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pnDataLength</em>&nbsp;</td><td>(file) length returned in this variable. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bUnlinkAndSeize</em>&nbsp;</td><td>TRUE to remove the file, or FALSE to leave unaltered.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to memory buffer or NULL on failure. </dd></dl>

<p>References <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00771">VSIGetMemFileBuffer()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00771">VSIGetMemFileBuffer()</a>.</p>

</div>
</div>
<a class="anchor" id="a3cde09f204df6f417653b7af4761178e"></a><!-- doxytag: member="cpl_vsi.h::VSIInstallGZipFileHandler" ref="a3cde09f204df6f417653b7af4761178e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void VSIInstallGZipFileHandler </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Install GZip file system handler. </p>
<p>A special file handler is installed that allows reading on-the-fly in GZip (.gz) files. All portions of the file system underneath the base path "/vsigzip/" will be handled by this driver.</p>
<p>Additional documentation is to be found at <a href="http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip">http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip</a> </p>

<p>References <a class="el" href="cpl__vsil__gzip_8cpp_source.html#l01173">VSIInstallGZipFileHandler()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil__gzip_8cpp_source.html#l01173">VSIInstallGZipFileHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="a66e2e6f093fd42f8a941b962d4c8a19e"></a><!-- doxytag: member="cpl_vsi.h::VSIInstallMemFileHandler" ref="a66e2e6f093fd42f8a941b962d4c8a19e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void VSIInstallMemFileHandler </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Install "memory" file system handler. </p>
<p>A special file handler is installed that allows block of memory to be treated as files. All portions of the file system underneath the base path "/vsimem/" will be handled by this driver.</p>
<p>Normal VSI*L functions can be used freely to create and destroy memory arrays treating them as if they were real file system objects. Some additional methods exist to efficient create memory file system objects without duplicating original copies of the data or to "steal" the block of memory associated with a memory file.</p>
<p>At this time the memory handler does not properly handle directory semantics for the memory portion of the filesystem. The <a class="el" href="cpl__vsi_8h.html#a6158d73485d6cf92c75b38e7f26d00c3" title="Read names in a directory.">VSIReadDir()</a> function is not supported though this will be corrected in the future.</p>
<p>Calling this function repeatedly should do no harm, though it is not necessary. It is already called the first time a virtualizable file access function (ie. <a class="el" href="cpl__vsi_8h.html#a48b5fab6cc22a9d0a543c095ee358634" title="Open file.">VSIFOpenL()</a>, VSIMkDir(), etc) is called.</p>
<p>This code example demonstrates using GDAL to translate from one memory buffer to another.</p>
<div class="fragment"><pre class="fragment"> GByte *ConvertBufferFormat( GByte *pabyInData, vsi_l_offset nInDataLength, 
                             vsi_l_offset *pnOutDataLength )
 {
     <span class="comment">// create memory file system object from buffer.</span>
     <a class="code" href="cpl__vsi_8h.html#ab1fc5cbfff98db8f5aa912606b07e8d9" title="Close file.">VSIFCloseL</a>( <a class="code" href="cpl__vsi_8h.html#a1ecb3a78729ecea4d2ce22065a605244" title="Create memory &amp;quot;file&amp;quot; from a buffer.">VSIFileFromMemBuffer</a>( <span class="stringliteral">&quot;/vsimem/work.dat&quot;</span>, pabyInData,
                                       nInDataLength, FALSE ) );

     <span class="comment">// Open memory buffer for read.</span>
     GDALDatasetH hDS = GDALOpen( <span class="stringliteral">&quot;/vsimem/work.dat&quot;</span>, GA_ReadOnly );
 
     <span class="comment">// Get output format driver. </span>
     GDALDriverH hDriver = GDALGetDriverByName( <span class="stringliteral">&quot;GTiff&quot;</span> );
     GDALDatasetH hOutDS;

     hOutDS = GDALCreateCopy( hDriver, <span class="stringliteral">&quot;/vsimem/out.tif&quot;</span>, hDS, TRUE, NULL, 
                              NULL, NULL );
 
     <span class="comment">// close source file, and &quot;unlink&quot; it.  </span>
     GDALClose( hDS );
     <a class="code" href="cpl__vsi_8h.html#a69dad1bd6f1af9935c1523db0c6c212f" title="Delete a file.">VSIUnlink</a>( <span class="stringliteral">&quot;/vsimem/work.dat&quot;</span> );

     <span class="comment">// seize the buffer associated with the output file.</span>

     <span class="keywordflow">return</span> <a class="code" href="cpl__vsi_8h.html#aeaf26bcc4a5314371f426bb2a5e6ce7a" title="Fetch buffer underlying memory file.">VSIGetMemFileBuffer</a>( <span class="stringliteral">&quot;/vsimem/out.tif&quot;</span>, pnOutDataLength, TRUE );
 }
</pre></div> 
<p>References <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00692">VSIInstallMemFileHandler()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00722">VSIFileFromMemBuffer()</a>, and <a class="el" href="cpl__vsi__mem_8cpp_source.html#l00692">VSIInstallMemFileHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="a884fac3cd6be2c09deb807e959d78b3a"></a><!-- doxytag: member="cpl_vsi.h::VSIInstallZipFileHandler" ref="a884fac3cd6be2c09deb807e959d78b3a" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void VSIInstallZipFileHandler </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Install ZIP file system handler. </p>
<p>A special file handler is installed that allows reading on-the-fly in ZIP (.zip) archives. All portions of the file system underneath the base path "/vsizip/" will be handled by this driver.</p>
<p>Additional documentation is to be found at <a href="http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip">http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip</a> </p>

<p>References <a class="el" href="cpl__vsil__gzip_8cpp_source.html#l01751">VSIInstallZipFileHandler()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil__gzip_8cpp_source.html#l01751">VSIInstallZipFileHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="a9b88331b0be4f7f2bd43e7b830af7038"></a><!-- doxytag: member="cpl_vsi.h::VSIMalloc2" ref="a9b88331b0be4f7f2bd43e7b830af7038" args="(size_t nSize1, size_t nSize2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* VSIMalloc2 </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>VSIMalloc2 allocates (nSize1 * nSize2) bytes. In case of overflow of the multiplication, or if memory allocation fails, a NULL pointer is returned and a CE_Failure error is raised with <a class="el" href="cpl__error_8h.html#aad2b98dd58e4de706a245faddac90403">CPLError()</a>. If nSize1 == 0 || nSize2 == 0, a NULL pointer will also be returned. CPLFree() or VSIFree() can be used to free memory allocated by this function. </p>

<p>References <a class="el" href="cpl__vsisimple_8cpp_source.html#l00427">VSIMalloc2()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsisimple_8cpp_source.html#l00427">VSIMalloc2()</a>.</p>

</div>
</div>
<a class="anchor" id="a644254757e7d9ec23df256d34fff565d"></a><!-- doxytag: member="cpl_vsi.h::VSIMalloc3" ref="a644254757e7d9ec23df256d34fff565d" args="(size_t nSize1, size_t nSize2, size_t nSize3)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* VSIMalloc3 </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>nSize3</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>VSIMalloc3 allocates (nSize1 * nSize2 * nSize3) bytes. In case of overflow of the multiplication, or if memory allocation fails, a NULL pointer is returned and a CE_Failure error is raised with <a class="el" href="cpl__error_8h.html#aad2b98dd58e4de706a245faddac90403">CPLError()</a>. If nSize1 == 0 || nSize2 == 0 || nSize3 == 0, a NULL pointer will also be returned. CPLFree() or VSIFree() can be used to free memory allocated by this function. </p>

<p>References <a class="el" href="cpl__vsisimple_8cpp_source.html#l00459">VSIMalloc3()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsisimple_8cpp_source.html#l00459">VSIMalloc3()</a>.</p>

</div>
</div>
<a class="anchor" id="aef0a5243bbc47cf9645a135d0c7d26df"></a><!-- doxytag: member="cpl_vsi.h::VSIMkdir" ref="aef0a5243bbc47cf9645a135d0c7d26df" args="(const char *pathname, long mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIMkdir </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszPathname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&nbsp;</td>
          <td class="paramname"> <em>mode</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a directory. </p>
<p>Create a new directory with the indicated mode. The mode is ignored on some platforms. A reasonable default mode value would be 0666. This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX mkdir() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszPathname</em>&nbsp;</td><td>the path to the directory to create. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>mode</em>&nbsp;</td><td>the permissions mode.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on an error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00105">VSIMkdir()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil_8cpp_source.html#l00105">VSIMkdir()</a>.</p>

</div>
</div>
<a class="anchor" id="a6158d73485d6cf92c75b38e7f26d00c3"></a><!-- doxytag: member="cpl_vsi.h::VSIReadDir" ref="a6158d73485d6cf92c75b38e7f26d00c3" args="(const char *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char** VSIReadDir </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszPath</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read names in a directory. </p>
<p>This function abstracts access to directory contains. It returns a list of strings containing the names of files, and directories in this directory. The resulting string list becomes the responsibility of the application and should be freed with <a class="el" href="cpl__string_8h.html#a5a39b9c5896a273cc6f06c1d5be93238">CSLDestroy()</a> when no longer needed.</p>
<p>Note that no error is issued via <a class="el" href="cpl__error_8h.html#aad2b98dd58e4de706a245faddac90403">CPLError()</a> if the directory path is invalid, though NULL is returned.</p>
<p>This function used to be known as CPLReadDir(), but the old name is now deprecated.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszPath</em>&nbsp;</td><td>the relative, or absolute path of a directory to read. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The list of entries in the directory, or NULL if the directory doesn't exist. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00060">VSIReadDir()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil_8cpp_source.html#l00060">VSIReadDir()</a>.</p>

</div>
</div>
<a class="anchor" id="a26cae93b5a32e11bef9ec7c118f8cca4"></a><!-- doxytag: member="cpl_vsi.h::VSIRename" ref="a26cae93b5a32e11bef9ec7c118f8cca4" args="(const char *oldpath, const char *newpath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIRename </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>oldpath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>newpath</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Rename a file. </p>
<p>Renames a file object in the file system. It should be possible to rename a file onto a new filesystem, but it is safest if this function is only used to rename files that remain in the same directory.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX rename() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>oldpath</em>&nbsp;</td><td>the name of the file to be renamed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>newpath</em>&nbsp;</td><td>the name the file should be given.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on an error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00164">VSIRename()</a>.</p>

<p>Referenced by <a class="el" href="cpl__vsil_8cpp_source.html#l00164">VSIRename()</a>.</p>

</div>
</div>
<a class="anchor" id="a763cceaa0966f37b71a0185c92bb3ad8"></a><!-- doxytag: member="cpl_vsi.h::VSIRmdir" ref="a763cceaa0966f37b71a0185c92bb3ad8" args="(const char *pathname)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIRmdir </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszDirname</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Delete a directory. </p>
<p>Deletes a directory object from the file system. On some systems the directory must be empty before it can be deleted.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX rmdir() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszDirname</em>&nbsp;</td><td>the path of the directory to be deleted.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on an error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00193">VSIRmdir()</a>.</p>

<p>Referenced by <a class="el" href="cpl__conv_8cpp_source.html#l01919">CPLUnlinkTree()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00193">VSIRmdir()</a>.</p>

</div>
</div>
<a class="anchor" id="ac92fbd5e6fc143b026001b32c4c19ed1"></a><!-- doxytag: member="cpl_vsi.h::VSIStatL" ref="ac92fbd5e6fc143b026001b32c4c19ed1" args="(const char *, VSIStatBufL *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIStatL </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszFilename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VSIStatBufL *&nbsp;</td>
          <td class="paramname"> <em>psStatBuf</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get filesystem object info. </p>
<p>Fetches status information about a filesystem object (file, directory, etc). The returned information is placed in the VSIStatBufL structure. For portability only the st_size (size in bytes), and st_mode (file type). This method is similar to VSIStat(), but will work on large files on systems where this requires special calls.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX stat() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszFilename</em>&nbsp;</td><td>the path of the filesystem object to be queried. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>psStatBuf</em>&nbsp;</td><td>the structure to load with information.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on an error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00226">VSIStatL()</a>.</p>

<p>Referenced by <a class="el" href="cpl__conv_8cpp_source.html#l02142">CPLCheckForFile()</a>, <a class="el" href="cpl__path_8cpp_source.html#l00505">CPLFormCIFilename()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00226">VSIStatL()</a>.</p>

</div>
</div>
<a class="anchor" id="a69dad1bd6f1af9935c1523db0c6c212f"></a><!-- doxytag: member="cpl_vsi.h::VSIUnlink" ref="a69dad1bd6f1af9935c1523db0c6c212f" args="(const char *pathname)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int VSIUnlink </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pszFilename</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Delete a file. </p>
<p>Deletes a file object from the file system.</p>
<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.</p>
<p>Analog of the POSIX unlink() function.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pszFilename</em>&nbsp;</td><td>the path of the file to be deleted.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or -1 on an error. </dd></dl>

<p>References <a class="el" href="cpl__vsil_8cpp_source.html#l00133">VSIUnlink()</a>.</p>

<p>Referenced by <a class="el" href="cpl__conv_8cpp_source.html#l01919">CPLUnlinkTree()</a>, and <a class="el" href="cpl__vsil_8cpp_source.html#l00133">VSIUnlink()</a>.</p>

</div>
</div>
</div>
<hr>

Generated for GDAL by 
<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.2-20100208.
</body>
</html>