- From: Eric Uhrhane via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 08 Sep 2010 18:17:08 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/file-system In directory hutz:/tmp/cvs-serv8658 Modified Files: file-dir-sys.html Log Message: Fixed case on CREATE and EXCLUSIVE. Fixed outdated examples. Index: file-dir-sys.html =================================================================== RCS file: /sources/public/2009/dap/file-system/file-dir-sys.html,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- file-dir-sys.html 25 Aug 2010 18:33:19 -0000 1.16 +++ file-dir-sys.html 8 Sep 2010 18:17:06 -0000 1.17 @@ -132,14 +132,14 @@ <h2>Examples</h2> <pre class='example sh_javascript'> function useAsyncFS(fs) { - // a FileEntry is a File; see getAsText example in [[!FILE-API]]. + // see getAsText example in [[!FILE-API]]. fs.root.getFile("already_there.txt", null, function (f) { - getAsText(f); + getAsText(f.file()); }); // But now we can also write to the file; see [[!FILE-WRITER]]. - fs.root.getFile("logFile", fs.root.CREATE, function (f) { - writeDataToLogFile(f.createWriter()); + fs.root.getFile("logFile", {create: true}, function (f) { + f.createWriter(writeDataToLogFile); }); } @@ -147,12 +147,12 @@ requestFileSystem(false, 1024 * 1024, function(fs) { useAsyncFS(fs); - } + }); // In a worker: var tempFS = requestFileSystem(false, 1024 * 1024); - var logFile = tempFS.root.getFile("logFile", tempFS.root.CREATE); + var logFile = tempFS.root.getFile("logFile", {create: true}); var writer = logFile.createWriter(); writer.seek(writer.length); writeDataToLogFile(writer); @@ -449,28 +449,28 @@ create files or directories. </p> <dl title='[NoInterfaceObject] interface Metadata' class='idl'> - <dt>attribute boolean CREATE</dt> + <dt>attribute boolean create</dt> <dd> Used to indicate that the user wants to create a file or directory if it was not previously there. </dd> - <dt>attribute boolean EXCLUSIVE</dt> + <dt>attribute boolean exclusive</dt> <dd> - By itself, EXCLUSIVE MUST have no effect. - Used with CREATE, it causes getFile and getDirectory to fail if the - target path already exists. + By itself, <code>exclusive</code> MUST have no effect. Used with + <code>create</code>, it causes getFile and getDirectory to + fail if the target path already exists. </dd> </dl> <section class='informative'> <h2>Examples</h2> <pre class='example sh_javascript'> // Get the data directory, creating it if it doesn't exist. - dataDir = fsSync.root.getDirectory("data", {CREATE: true}); + dataDir = fsSync.root.getDirectory("data", {create: true}); // Create the lock file, if and only if it doesn't exist. try { lockFile = dataDir.getFile("lockfile.txt", - {CREATE: true, EXCLUSIVE: true}); + {create: true, exclusive: true}); } catch (ex) { // It already exists, or something else went wrong. ... @@ -691,15 +691,15 @@ <dt>optional Flags options</dt> <dd> <ul> - <li>If CREATE and EXCLUSIVE are both true, and the path - already exists, getFile MUST fail.</li> - <li>If CREATE is true, the path doesn't exist, and no - other error occurs, getFile MUST create it as a zero-length - file and return a corresponding FileEntry.</li> - <li>If CREATE is not true and the path doesn't exist, - getFile MUST fail.</li> - <li>If CREATE is not true and the path exists, but is a - directory, getFile MUST fail.</li> + <li>If <code>create</code> and <code>exclusive</code> are both + true, and the path already exists, getFile MUST fail.</li> + <li>If <code>create</code> is true, the path doesn't exist, + and no other error occurs, getFile MUST create it as a + zero-length file and return a corresponding FileEntry.</li> + <li>If <code>create</code> is not true and the path doesn't + exist, getFile MUST fail.</li> + <li>If <code>create</code> is not true and the path exists, + but is a directory, getFile MUST fail.</li> <li>Otherwise, if no other error occurs, getFile MUST return a FileEntry corresponding to path.</li> </ul> @@ -731,15 +731,15 @@ <dt>optional Flags options</dt> <dd> <ul> - <li>If CREATE and EXCLUSIVE are both true and the path already - exists, getDirectory MUST fail.</li> - <li>If CREATE is true, the path doesn't exist, and no - other error occurs, getDirectory MUST create and return + <li>If <code>create</code> and <code>exclusive</code> are both + true and the path already exists, getDirectory MUST fail.</li> + <li>If <code>create</code> is true, the path doesn't exist, + and no other error occurs, getDirectory MUST create and return a corresponding DirectoryEntry.</li> - <li>If CREATE is not true and the path doesn't exist, - getDirectory MUST fail.</li> - <li>If CREATE is not true and the path exists, but is a - file, getDirectory MUST fail.</li> + <li>If <code>create</code> is not true and the path doesn't + exist, getDirectory MUST fail.</li> + <li>If <code>create</code> is not true and the path exists, + but is a file, getDirectory MUST fail.</li> <li>Otherwise, if no other error occurs, getDirectory MUST return a DirectoryEntry corresponding to path.</li> </ul> @@ -1229,15 +1229,15 @@ <dt>optional unsigned short options</dt> <dd> <ul> - <li>If CREATE and EXCLUSIVE are both true and the path - already exists, getFile MUST fail.</li> - <li>If CREATE is true, the path doesn't exist, and no - other error occurs, getFile MUST create it as a zero-length - file and return a corresponding FileEntry.</li> - <li>If CREATE is not true and the path doesn't exist, - getFile MUST fail.</li> - <li>If CREATE is not true and the path exists, but is a - directory, getFile MUST fail.</li> + <li>If <code>create</code> and <code>exclusive</code> are both + true and the path already exists, getFile MUST fail.</li> + <li>If <code>create</code> is true, the path doesn't exist, + and no other error occurs, getFile MUST create it as a + zero-length file and return a corresponding FileEntry.</li> + <li>If <code>create</code> is not true and the path doesn't + exist, getFile MUST fail.</li> + <li>If <code>create</code> is not true and the path exists, + but is a directory, getFile MUST fail.</li> <li>Otherwise, if no other error occurs, getFile MUST return a FileEntrySync corresponding to path.</li> </ul> @@ -1278,15 +1278,15 @@ <dt>optional unsigned short options</dt> <dd> <ul> - <li>If CREATE and EXCLUSIVE are both true and the path already - exists, getDirectory MUST fail.</li> - <li>If CREATE is true, the path doesn't exist, and no - other error occurs, getDirectory MUST create and return + <li>If <code>create</code> and <code>exclusive</code> are both + true and the path already exists, getDirectory MUST fail.</li> + <li>If <code>create</code> is true, the path doesn't exist, + and no other error occurs, getDirectory MUST create and return a corresponding DirectoryEntry.</li> - <li>If CREATE is not true and the path doesn't exist, - getDirectory MUST fail.</li> - <li>If CREATE is not true and the path exists, but is a - file, getDirectory MUST fail.</li> + <li>If <code>create</code> is not true and the path doesn't + exist, getDirectory MUST fail.</li> + <li>If <code>create</code> is not true and the path exists, + but is a file, getDirectory MUST fail.</li> <li>Otherwise, if no other error occurs, getDirectory MUST return a DirectoryEntrySync corresponding to path.</li> </ul>
Received on Wednesday, 8 September 2010 18:17:09 UTC