Class FileSystemHandle
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The FileSystemHandle interface of the 'File System API' is an object which represents a file or directory entry. Multiple handles can represent the same entry. For the most part you do not work with FileSystemHandle directly but rather its child interfaces 'FileSystemFileHandle' and 'FileSystemDirectoryHandle'.
[Value("FileSystemHandle")]
public class FileSystemHandle
- Inheritance
-
FileSystemHandle
- Derived
- Inherited Members
Remarks
Constructors
FileSystemHandle()
public FileSystemHandle()
Properties
Kind
The kind read-only property of the
FileSystemHandle interface returns the type of entry. This is'file' if the associated entry is a file or 'directory'. It is
used to distinguish files from directories when iterating over the contents of a
directory.
[Value("kind")]
public FileSystemHandleKind Kind { get; }
Property Value
- FileSystemHandleKind
A string that can be:
Remarks
Name
The name read-only property of the
FileSystemHandle interface returns the name of the entry represented by
handle.
[Value("name")]
public string Name { get; }
Property Value
- string
A string.
Remarks
Methods
IsSameEntry(FileSystemHandle)
The isSameEntry() method of the
FileSystemHandle interface compares two FileSystemHandle to see if the associated entries (either a file or directory) match.
[Value("isSameEntry")]
public Task<bool> IsSameEntry(FileSystemHandle other)
Parameters
otherFileSystemHandle
Returns
Remarks
QueryPermission(FileSystemHandlePermissionDescriptor)
NOTE
ExperimentalqueryPermission() method of theFileSystemHandle interface queries the current permission state of the
current handle.
[Value("queryPermission")]
public Task<PermissionState> QueryPermission(FileSystemHandlePermissionDescriptor descriptor = null)
Parameters
descriptorFileSystemHandlePermissionDescriptor
Returns
- Task<PermissionState>
A {{jsxref("Promise")}} that resolves with 'PermissionStatus.State' which is one of
'granted','denied'or'prompt'. It may also reject with one of the exceptions below.If this resolves with "prompt", the website will have to callrequestPermission()before any
operations on the handle can be done. If this resolves with "denied" any operations will
reject. Usually handles returned by the local file system handle factories will
initially resolves with "granted" for their read permission state. However, other than through
the user revoking permission, a handle retrieved from IndexedDB is also likely to resolves with
"prompt".
Remarks
RequestPermission(FileSystemHandlePermissionDescriptor)
NOTE
ExperimentalrequestPermission() method of theFileSystemHandle interface requests read or readwrite permissions for the
file handle.
[Value("requestPermission")]
public Task<PermissionState> RequestPermission(FileSystemHandlePermissionDescriptor descriptor = null)
Parameters
descriptorFileSystemHandlePermissionDescriptor
Returns
- Task<PermissionState>
A {{jsxref("Promise")}} that resolves with 'PermissionStatus.State' which is one of
'granted','denied'or'prompt'. It may also reject with one of the exceptions below.