Skip to content

Commit

Permalink
Pagemacro filesystemflags (#10092)
Browse files Browse the repository at this point in the history
* Page macro - remove from FileSystemFlags

* Remove filesystemflags create/exclusive sub pages

* Fix up table heading
  • Loading branch information
hamishwillee authored Oct 28, 2021
1 parent a384090 commit d286fa9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 142 deletions.
2 changes: 2 additions & 0 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7422,6 +7422,8 @@
/en-US/docs/Web/API/FileRequest.onprogress /en-US/docs/Web/API/FileRequest/onprogress
/en-US/docs/Web/API/FileSystemFileEntry/FileSystemFileEntry.createWriter /en-US/docs/Web/API/FileSystemFileEntry/createWriter
/en-US/docs/Web/API/FileSystemFileEntry/FileSystemFileEntry.createWriter() /en-US/docs/Web/API/FileSystemFileEntry/createWriter
/en-US/docs/Web/API/FileSystemFlags/create /en-US/docs/Web/API/FileSystemFlags
/en-US/docs/Web/API/FileSystemFlags/exclusive /en-US/docs/Web/API/FileSystemFlags
/en-US/docs/Web/API/File_System_API /en-US/docs/Web/API/File_and_Directory_Entries_API
/en-US/docs/Web/API/File_System_API/Introduction /en-US/docs/Web/API/File_and_Directory_Entries_API/Introduction
/en-US/docs/Web/API/Float32Array /en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array
Expand Down
16 changes: 0 additions & 16 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -46053,22 +46053,6 @@
"Sheppy"
]
},
"Web/API/FileSystemFlags/create": {
"modified": "2020-10-15T21:49:31.156Z",
"contributors": [
"sideshowbarker",
"fscholz",
"Sheppy"
]
},
"Web/API/FileSystemFlags/exclusive": {
"modified": "2020-10-15T21:49:29.974Z",
"contributors": [
"sideshowbarker",
"fscholz",
"Sheppy"
]
},
"Web/API/FileSystemHandle": {
"modified": "2020-12-12T11:21:27.430Z",
"contributors": [
Expand Down
48 changes: 0 additions & 48 deletions files/en-us/web/api/filesystemflags/create/index.md

This file was deleted.

48 changes: 0 additions & 48 deletions files/en-us/web/api/filesystemflags/exclusive/index.md

This file was deleted.

55 changes: 25 additions & 30 deletions files/en-us/web/api/filesystemflags/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ browser-compat: api.FileSystemFlags
---
{{APIRef("File and Directory Entries API")}}

The **`FileSystemFlags`** dictionary defines a set of values which are used when specifying option flags when calling certain methods in the [File and Directory Entries API](/en-US/docs/Web/API/File_and_Directory_Entries_API). Methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this:
The **`FileSystemFlags`** dictionary defines a set of values which are used when specifying option flags when calling certain methods in the [File and Directory Entries API](/en-US/docs/Web/API/File_and_Directory_Entries_API).
Methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this:

```js
dataDirectoryEntry.getDirectory("Workspace", { create: true }, function(entry) {
Expand All @@ -26,10 +27,14 @@ Here, we see that the `create` property is provided, with a value of `true`, ind
## Properties

- {{domxref("FileSystemFlags.create", "create")}} {{optional_inline}}
- : If this property is `true`, and the requested file or directory doesn't exist, the user agent should create it. The default is `false`. The parent directory must already exist.
- {{domxref("FileSystemFlags.exclusive", "exclusive")}} {{optional_inline}}
- : If `true`, and the `create` option is also `true`, the file must not exist prior to issuing the call. Instead, it must be possible for it to be created newly at call time. The default is `false`.
- `create` {{optional_inline}}
- : If this property is `true`, and the requested file or directory doesn't exist, the user agent should create it.
The default is `false`.
The parent directory must already exist.
- `exclusive` {{optional_inline}}
- : If `true`, and the `create` option is also `true`, the file must not exist prior to issuing the call.
Instead, it must be possible for it to be created newly at call time.
The default is `false`.

### Values and results

Expand All @@ -45,37 +50,29 @@ Note that, when `create` is `false`, the value of `exclusive` is irrelevant and
<th rowspan="2" scope="col">Result</th>
</tr>
<tr>
<th scope="col">
{{domxref("FileSystemFlags.create", "create")}}
</th>
<th scope="col">
{{domxref("FileSystemFlags.exclusive", "exclusive")}}
</th>
<th scope="col"><code>create</code></th>
<th scope="col"><code>exclusive</code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>false</code></td>
<td>n/a</td>
<td>
Path exists and matches the desired type (depending on whether the
function called is <code>getFile()</code> or <code>getDirectory()</code>
Path exists and matches the desired type (depending on whether the function called is <code>getFile()</code> or <code>getDirectory()</code>
</td>
<td>
The <code>successCallback</code> is called with a
{{domxref("FileSystemFileEntry")}} if
<code>getFile()</code> was called or a
{{domxref("FileSystemDirectoryEntry")}} if
<code>getDirectory()</code> was called.
{{domxref("FileSystemFileEntry")}} if <code>getFile()</code> was called or a
{{domxref("FileSystemDirectoryEntry")}} if <code>getDirectory()</code> was called.
</td>
</tr>
<tr>
<td><code>false</code></td>
<td>n/a</td>
<td>Path exists but doesn't match the desired type</td>
<td>
The <code>errorCallback</code> is called with an appropriate error code
(if the callback was provided).
The <code>errorCallback</code> is called with an appropriate error code (if the callback was provided).
</td>
</tr>
<tr>
Expand All @@ -85,17 +82,15 @@ Note that, when `create` is `false`, the value of `exclusive` is irrelevant and
<td>
The existing file or directory is removed and replaced with a new one,
then the <code>successCallback</code> is called with a
{{domxref("FileSystemFileEntry")}} or a
{{domxref("FileSystemDirectoryEntry")}}, as appropriate.
{{domxref("FileSystemFileEntry")}} or a {{domxref("FileSystemDirectoryEntry")}}, as appropriate.
</td>
</tr>
<tr>
<td><code>true</code></td>
<td><code>false</code></td>
<td>Path doesn't exist</td>
<td>
The file or directory is created, then a
{{domxref("FileSystemFileEntry")}} or a
The file or directory is created, then a {{domxref("FileSystemFileEntry")}} or a
{{domxref("FileSystemDirectoryEntry")}} is passed to the
<code>successCallback</code>, as appropriate.
</td>
Expand All @@ -114,20 +109,20 @@ Note that, when `create` is `false`, the value of `exclusive` is irrelevant and
<td><code>true</code></td>
<td>Path doesn't exist</td>
<td>
The file or directory is created, then a
{{domxref("FileSystemFileEntry")}} or a
{{domxref("FileSystemDirectoryEntry")}} is passed to the
<code>successCallback</code>, as appropriate.
The file or directory is created, then a {{domxref("FileSystemFileEntry")}} or a
{{domxref("FileSystemDirectoryEntry")}} is passed to the <code>successCallback</code>, as appropriate.
</td>
</tr>
</tbody>
</table>

## Specifications

| Specification | Status | Comment |
| ------------------------------------ | -------------------------------- | --------------- |
| {{SpecName('File System API', '#dictdef-filesystemflags')}} | {{Spec2('File System API')}} | |
{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

Expand Down

0 comments on commit d286fa9

Please sign in to comment.