@@ -244,9 +244,9 @@ a <dfn export for="file system locator" id=locator-root>root</dfn> (a [=file sys
244
244
Issue(109): Consider giving each locator a [=storage bucket=] .
245
245
246
246
A <dfn export>file locator</dfn> is a [=/file system locator=] whose
247
- [=file system locator/kind=] is {{FileSystemHandleKind/" file"}} .
247
+ [=file system locator/kind=] is " {{FileSystemHandleKind/file}} " .
248
248
A <dfn export>directory locator</dfn> is a [=/file system locator=] whose
249
- [=file system locator/kind=] is {{FileSystemHandleKind/" directory"}} .
249
+ [=file system locator/kind=] is " {{FileSystemHandleKind/directory}} " .
250
250
251
251
A <dfn export>file system root</dfn> is an opaque [=string=] whose value is
252
252
[=implementation-defined=] .
@@ -255,7 +255,7 @@ A <dfn export>file system root</dfn> is an opaque [=string=] whose value is
255
255
whichs [=locate an entry|locates to=] a [=file entry=] |entry| that conceptually
256
256
exists at the path `data/drafts/example.txt` relative to the root directory of
257
257
a [=/bucket file system=] ,
258
- |locator|'s [=file system locator/kind=] has to be {{FileSystemHandleKind/" file"}} ,
258
+ |locator|'s [=file system locator/kind=] has to be " {{FileSystemHandleKind/file}} " ,
259
259
|locator|'s [=file system locator/path=] has to be « "`data`", "`drafts`", "`example.txt`" », and
260
260
|locator|'s [=file system locator/root=] might include relevant identifying
261
261
information such as the [=storage bucket=] and the disk drive.
@@ -377,8 +377,8 @@ Their [=deserialization steps=], given |serialized| and |value| are:
377
377
378
378
<div class="note domintro">
379
379
: |handle| . {{FileSystemHandle/kind}}
380
- :: Returns {{FileSystemHandleKind/" file"}} if |handle| is a {{FileSystemFileHandle}} ,
381
- or {{FileSystemHandleKind/" directory"}} if |handle| is a {{FileSystemDirectoryHandle}} .
380
+ :: Returns " {{FileSystemHandleKind/file}} " if |handle| is a {{FileSystemFileHandle}} ,
381
+ or " {{FileSystemHandleKind/directory}} " if |handle| is a {{FileSystemDirectoryHandle}} .
382
382
383
383
This can be used to distinguish files from directories when iterating over the contents
384
384
of a directory.
@@ -433,15 +433,15 @@ interface FileSystemFileHandle : FileSystemHandle {
433
433
</xmp>
434
434
435
435
Note: A {{FileSystemFileHandle}} 's associated [=FileSystemHandle/locator=]' s
436
- [=file system locator/kind=] is {{FileSystemHandleKind/" file"}} .
436
+ [=file system locator/kind=] is " {{FileSystemHandleKind/file}} " .
437
437
438
438
<div algorithm>
439
439
To
440
440
<dfn data-lt="creating a child FileSystemFileHandle">create a child `FileSystemFileHandle`</code></dfn>
441
441
given a [=directory locator=] |parentLocator| and a string |name| in a [=/Realm=] |realm|:
442
442
443
443
1. Let |handle| be a [=new=] {{FileSystemFileHandle}} in |realm|.
444
- 1. Let |childType| be {{FileSystemHandleKind/" file"}} .
444
+ 1. Let |childType| be " {{FileSystemHandleKind/file}} " .
445
445
1. Let |childRoot| be a copy of |parentLocator|'s [=file system locator/root=] .
446
446
1. Let |childPath| be the result of [=list/clone|cloning=] |parentLocator|'s
447
447
[=file system locator/path=] and [=list/append|appending=] |name|.
@@ -461,7 +461,7 @@ in a [=/Realm=] |realm|:
461
461
462
462
1. Let |handle| be a [=new=] {{FileSystemFileHandle}} in |realm|.
463
463
1. Set |handle|'s [=FileSystemHandle/locator=] to a [=/file system locator=] whose
464
- [=file system locator/kind=] is {{FileSystemHandleKind/" file"}} ,
464
+ [=file system locator/kind=] is " {{FileSystemHandleKind/file}} " ,
465
465
[=file system locator/root=] is |root|, and
466
466
[=file system locator/path=] is |path|.
467
467
1. Return |handle|.
@@ -688,15 +688,15 @@ interface FileSystemDirectoryHandle : FileSystemHandle {
688
688
</xmp>
689
689
690
690
Note: A {{FileSystemDirectoryHandle}} 's associated [=FileSystemHandle/locator=]' s
691
- [=file system locator/kind=] is {{FileSystemHandleKind/" directory"}} .
691
+ [=file system locator/kind=] is " {{FileSystemHandleKind/directory}} " .
692
692
693
693
<div algorithm>
694
694
To
695
695
<dfn data-lt="creating a child FileSystemDirectoryHandle">create a child `FileSystemDirectoryHandle`</dfn>
696
696
given a [=directory locator=] |parentLocator| and a string |name| in a [=/Realm=] |realm|:
697
697
698
698
1. Let |handle| be a [=new=] {{FileSystemDirectoryHandle}} in |realm|.
699
- 1. Let |childType| be {{FileSystemHandleKind/" directory"}} .
699
+ 1. Let |childType| be " {{FileSystemHandleKind/directory}} " .
700
700
1. Let |childRoot| be a copy of |parentLocator|'s [=file system locator/root=] .
701
701
1. Let |childPath| be the result of [=list/clone|cloning=] |parentLocator|'s
702
702
[=file system locator/path=] and [=list/append|appending=] |name|.
@@ -716,7 +716,7 @@ in a [=/Realm=] |realm|:
716
716
717
717
1. Let |handle| be a [=new=] {{FileSystemDirectoryHandle}} in |realm|.
718
718
1. Set |handle|'s [=FileSystemHandle/locator=] to a [=/file system locator=] whose
719
- [=file system locator/kind=] is {{FileSystemHandleKind/" directory"}} ,
719
+ [=file system locator/kind=] is " {{FileSystemHandleKind/directory}} " ,
720
720
[=file system locator/root=] is |root|, and
721
721
[=file system locator/path=] is |path|.
722
722
1. Return |handle|.
@@ -1223,8 +1223,8 @@ runs these steps:
1223
1223
[=file system access result/error name=] and abort these steps.
1224
1224
1225
1225
1. Let |command| be |input|["{{WriteParams/type}}"] if
1226
- |input| is a [=/dictionary=] ; otherwise {{WriteCommandType/" write"}} .
1227
- 1. If |command| is {{WriteCommandType/" write"}} :
1226
+ |input| is a [=/dictionary=] ; otherwise " {{WriteCommandType/write}} " .
1227
+ 1. If |command| is " {{WriteCommandType/write}} " :
1228
1228
1. If |input| is `undefined` or |input| is a [=/dictionary=] and
1229
1229
|input|["{{WriteParams/data}}"] does not [=map/exists|exist=] ,
1230
1230
[=/reject=] |p| with a {{TypeError}} and abort these steps.
@@ -1275,14 +1275,14 @@ runs these steps:
1275
1275
1. Set |stream|'s [=[[seekOffset]]=] to |writePosition| + |data|' s
1276
1276
[=byte sequence/length=] .
1277
1277
1. [=/Resolve=] |p|.
1278
- 1. Otherwise, if |command| is {{WriteCommandType/" seek"}} :
1278
+ 1. Otherwise, if |command| is " {{WriteCommandType/seek}} " :
1279
1279
1. [=Assert=] : |chunk| is a [=/dictionary=] .
1280
1280
1. If |chunk|["{{WriteParams/position}}"] does not [=map/exists|exist=] ,
1281
1281
[=/reject=] |p| with a {{TypeError}} and abort these steps.
1282
1282
1. Set |stream|'s [=[[seekOffset]]=] to
1283
1283
|chunk|["{{WriteParams/position}}"] .
1284
1284
1. [=/Resolve=] |p|.
1285
- 1. Otherwise, if |command| is {{WriteCommandType/" truncate"}} :
1285
+ 1. Otherwise, if |command| is " {{WriteCommandType/truncate}} " :
1286
1286
1. [=Assert=] : |chunk| is a [=/dictionary=] .
1287
1287
1. If |chunk|["{{WriteParams/size}}"] does not [=map/exists|exist=] ,
1288
1288
[=/reject=] |p| with a {{TypeError}} and abort these steps.
@@ -1315,7 +1315,7 @@ runs these steps:
1315
1315
<div class="note domintro">
1316
1316
: await |stream| . {{FileSystemWritableFileStream/write()|write}} (|data|)
1317
1317
: await |stream| . {{FileSystemWritableFileStream/write()|write}} ({
1318
- {{WriteParams/type}} : {{WriteCommandType/" write"}} ,
1318
+ {{WriteParams/type}} : " {{WriteCommandType/write}} " ,
1319
1319
{{WriteParams/data}} : |data| })
1320
1320
:: Writes the content of |data| into the file associated with |stream| at the current file
1321
1321
cursor offset.
@@ -1324,7 +1324,7 @@ runs these steps:
1324
1324
Changes are typically written to a temporary file instead.
1325
1325
1326
1326
: await |stream| . {{FileSystemWritableFileStream/write()|write}} ({
1327
- {{WriteParams/type}} : {{WriteCommandType/" write"}} ,
1327
+ {{WriteParams/type}} : " {{WriteCommandType/write}} " ,
1328
1328
{{WriteParams/position}} : |position|,
1329
1329
{{WriteParams/data}} : |data| })
1330
1330
:: Writes the content of |data| into the file associated with |stream| at |position|
@@ -1335,12 +1335,12 @@ runs these steps:
1335
1335
Changes are typically written to a temporary file instead.
1336
1336
1337
1337
: await |stream| . {{FileSystemWritableFileStream/write()|write}} ({
1338
- {{WriteParams/type}} : {{WriteCommandType/" seek"}} ,
1338
+ {{WriteParams/type}} : " {{WriteCommandType/seek}} " ,
1339
1339
{{WriteParams/position}} : |position| })
1340
1340
:: Updates the current file cursor offset the |position| bytes from the top of the file.
1341
1341
1342
1342
: await |stream| . {{FileSystemWritableFileStream/write()|write}} ({
1343
- {{WriteParams/type}} : {{WriteCommandType/" truncate"}} ,
1343
+ {{WriteParams/type}} : " {{WriteCommandType/truncate}} " ,
1344
1344
{{WriteParams/size}} : |size| })
1345
1345
:: Resizes the file associated with |stream| to be |size| bytes long. If |size| is larger than
1346
1346
the current file size this pads the file with null bytes, otherwise it truncates the file.
@@ -1376,7 +1376,7 @@ The <dfn method for=FileSystemWritableFileStream>seek(|position|)</dfn> method s
1376
1376
1377
1377
1. Let |writer| be the result of [=WritableStream/getting a writer=] for [=this=] .
1378
1378
1. Let |result| be the result of [=WritableStreamDefaultWriter/writing a chunk=] to |writer| given
1379
- «[ "{{WriteParams/type}} " → {{WriteCommandType/" seek"}} , "{{WriteParams/position}} " →
1379
+ «[ "{{WriteParams/type}} " → " {{WriteCommandType/seek}} " , "{{WriteParams/position}} " →
1380
1380
|position| ]».
1381
1381
1. [=WritableStreamDefaultWriter/Release=] |writer|.
1382
1382
1. Return |result|.
@@ -1403,7 +1403,7 @@ The <dfn method for=FileSystemWritableFileStream>truncate(|size|)</dfn> method s
1403
1403
1404
1404
1. Let |writer| be the result of [=WritableStream/getting a writer=] for [=this=] .
1405
1405
1. Let |result| be the result of [=WritableStreamDefaultWriter/writing a chunk=] to |writer| given
1406
- «[ "{{WriteParams/type}} " → {{WriteCommandType/" truncate"}} , "{{WriteParams/size}} " →
1406
+ «[ "{{WriteParams/type}} " → " {{WriteCommandType/truncate}} " , "{{WriteParams/size}} " →
1407
1407
|size| ]».
1408
1408
1. [=WritableStreamDefaultWriter/Release=] |writer|.
1409
1409
1. Return |result|.
0 commit comments