2009/dap/file-system file-writer.html,1.16,1.17

Update of /sources/public/2009/dap/file-system
In directory hutz:/tmp/cvs-serv24033

Modified Files:
	file-writer.html 
Log Message:
Added extend-by-truncating.


Index: file-writer.html
===================================================================
RCS file: /sources/public/2009/dap/file-system/file-writer.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- file-writer.html	20 Aug 2010 01:05:41 -0000	1.16
+++ file-writer.html	16 Sep 2010 22:05:32 -0000	1.17
@@ -522,7 +522,7 @@
         multiple write actions, rather than just saving a single Blob.
       </p>
       <div class=issue>
-        Since this is intended to be used only with the sandboxed filessytem,
+        Since this is intended to be used only with the sandboxed filesystem,
         it should probably move to the <a
           href="http://dev.w3.org/2009/dap/file-system/file-dir-sys.html">filesystem
           spec</a>.
@@ -638,7 +638,10 @@
         <dt>void truncate ()</dt>
         <dd>
           <p>
-            Shortens the file to the length specified.
+            Changes the length of the file to that specified.  If shortening the
+            file, data beyond the new length MUST be discarded.  If extending
+            the file, the existing data MUST be zero-padded up to the new
+            length.
           </p>
           <p>
             When the <code>truncate</code> method is called, <a>user agents</a>
@@ -649,11 +652,6 @@
             <code>FileException</code> with error code
             <code>INVALID_STATE_ERR</code> and terminate this overall series of
             steps.</li>
-            <li>If <code>size</code> is greater than or equal to the
-            <code>length</code> of the <a>FileWriter</a>, throw a
-            <code>FileException</code> with error code
-            <code>INVALID_STATE_ERR</code> and terminate this overall series of
-            steps.</li>
             <li>Set <code>readyState</code> to <code>WRITING</code>.</li>
             <li>If an error occurs during truncate, set
               <code>readyState</code> to <code>DONE</code>.
@@ -675,15 +673,10 @@
             <li>Queue a task to dispatch a progress event called
               <code>writestart</code>.</li>
             <li>When the file has been truncated, set
-              <code>readyState</code> to <code>DONE</code>.  Upon successful
-              completion:
+            <code>readyState</code> to <code>DONE</code>.
+            <br />Upon successful completion:
               <ul>
-                <li><code>length</code> MUST be the lesser of
-                  <ul>
-                    <li>its pre-truncate value,</li>
-                    <li><code>size</code>.</li>
-                  </ul>
-                </li>
+                <li><code>length</code> MUST be equal to <code>size</code>.</li>
                 <li><code>position</code> MUST be the lesser of
                   <ul>
                     <li>its pre-truncate value,</li>
@@ -700,9 +693,8 @@
           <dl class='parameters'>
             <dt>long long size</dt>
             <dd>
-              The size to which the file is to be truncated, measured in bytes.
-              If <code>size</code> is greater than or equal to
-              <code>length</code>, this has no effect.
+              The size to which the length of the file is to be adjusted,
+              measured in bytes.
             </dd>
           </dl>
           <dl class='exception' title='FileException'>
@@ -725,7 +717,7 @@
         (WorkerUtils [[!WEBWORKERS]]).
       </p>
       <div class=issue>
-        Since this is intended to be used only with the sandboxed filessytem,
+        Since this is intended to be used only with the sandboxed filesystem,
         it should probably move to the <a
           href="http://dev.w3.org/2009/dap/file-system/file-dir-sys.html">filesystem
           spec</a>.
@@ -797,31 +789,28 @@
         <dt>void truncate ()</dt>
         <dd>
           <p>
-            Shortens the file to the length specified.
+            Changes the length of the file to that specified.  If shortening the
+            file, data beyond the new length MUST be discarded.  If extending
+            the file, the existing data MUST be zero-padded up to the new
+            length.
+          </p>
+          <p>
+            Upon successful completion:
+            <ul>
+              <li><code>length</code> MUST be equal to <code>size</code>.</li>
+              <li><code>position</code> MUST be the lesser of
+                <ul>
+                  <li>its pre-truncate value,</li>
+                  <li><code>size</code>.</li>
+                </ul>
+              </li>
+            </ul>
           </p>
           <dl class='parameters'>
             <dt>long long size</dt>
             <dd>
-              The size to which the file is truncated, measured in bytes.  If
-              <code>size</code> is greater than or equal to <code>length</code>,
-              this has no effect.
-              <p>
-                Upon successful completion:
-                <ul>
-                  <li><code>length</code> MUST be the lesser of
-                    <ul>
-                      <li>its pre-truncate value,</li>
-                      <li><code>size</code>.</li>
-                    </ul>
-                  </li>
-                  <li><code>position</code> MUST be the lesser of
-                    <ul>
-                      <li>its pre-truncate value,</li>
-                      <li><code>size</code>.</li>
-                    </ul>
-                  </li>
-                </ul>
-              </p>
+              The size to which the length of the file is to be adjusted,
+              measured in bytes.
             </dd>
           </dl>
           <dl class='exception' title='FileException'>
@@ -829,9 +818,6 @@
             <dd>The user attempted to modify a read-only file.</dd>
             <dt>NOT_FOUND_ERR</dt>
             <dd>The file to be truncated does not exist.</dd>
-            <dt>INVALID_STATE_ERR</dt>
-            <dd>At the time of the call, readyState was
-              <code>WRITING</code>.</dd>
             <dt>SECURITY_ERR</dt>
             <dd>The system has disallowed the truncation for security
             reasons.</dd>

Received on Thursday, 16 September 2010 22:05:36 UTC