</h1> <h2>Status: <code id="statusField">NO-STATUS</code></h2> <p> This example shows how you can use standard C library file operation functions in Native Client using a library called nacl_mounts. </p> <p> nacl_mounts provides a virtual filesystem. The filesystem can be "mounted" in a given directory tree. When you perform operations on files in those directories, the mount determines how those operations should be performed. </p> <p> This example has three mounts by default. <ol> <li><i>/</i> the root of the filesystem. This is a memory mount, and is non-persistent.</li> <li><i>/persistent</i> a persistent storage area. Any data written here can be read back after Chrome is restarted.</li> <li><i>/dev</i> a mount containing some utility files. /dev/null, /dev/zero, etc.</li> </ol> </p> <div> <span> <input type="radio" id="radiofopen" name="group" checked="checked">fopen <input type="radio" id="radiofclose" name="group">fclose <input type="radio" id="radiofread" name="group">fread <input type="radio" id="radiofwrite" name="group">fwrite <input type="radio" id="radiofseek" name="group">fseek </span> </div> <div class="function" id="fopen"> <span> Filename: <input type="text" id="fopenFilename"> <select id="fopenMode"> <option value="r">Read Existing (r)</option> <option value="r+">Read/Write Existing (r+)</option> <option value="w">Write New File (w)</option> <option value="w+">Read/Write New File (w+)</option> <option value="a">Append Write (a)</option> <option value="w+">Append Read/Write (a+)</option> </select> <button id="fopenExecute">fopen</button> </span> </div> <div class="function" id="fclose" hidden> <span> <select class="file-handle" id="fcloseHandle"></select> <button id="fcloseExecute">fclose</button> </span> </div> <div class="function" id="fread" hidden> <span> <select class="file-handle" id="freadHandle"></select> Count: <input type="text" id="freadBytes"> <button id="freadExecute">fread</button> </span> </div> <div class="function" id="fwrite" hidden> <span> <select class="file-handle" id="fwriteHandle"></select> Data: <input type="text" id="fwriteData"> <button id="fwriteExecute">fwrite</button> </span> </div> <div class="function" id="fseek" hidden> <span> <select class="file-handle" id="fseekHandle"></select> Offset: <input type="text" id="fseekOffset"> Whence: <select id="fseekWhence"> <option value="0">SEEK_SET</option> <option value="1">SEEK_CUR</option> <option value="2">SEEK_END</option> </select> <button id="fseekExecute">fseek</button> </span> </div> <!-- The NaCl plugin will be embedded inside the element with id "listener". See common.js.--> <div id="listener"></div> <div id="log"></div> </body> </html>