Table of Contents

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

other FileSystemHandle

Returns

Task<bool>

A Promise that fulfills with a 'Boolean'.

Remarks

QueryPermission(FileSystemHandlePermissionDescriptor)

NOTE
Experimental
The queryPermission() method of the
FileSystemHandle interface queries the current permission state of the
current handle.
[Value("queryPermission")]
public Task<PermissionState> QueryPermission(FileSystemHandlePermissionDescriptor descriptor = null)

Parameters

descriptor FileSystemHandlePermissionDescriptor

Returns

Task<PermissionState>

A {{jsxref("Promise")}} that resolves with 'PermissionStatus.State' which is one of &apos;granted&apos;, &apos;denied&apos; or &apos;prompt&apos;. It may also reject with one of the exceptions below.If this resolves with &quot;prompt&quot;, the website will have to call requestPermission() before any
operations on the handle can be done. If this resolves with &quot;denied&quot; any operations will
reject. Usually handles returned by the local file system handle factories will
initially resolves with &quot;granted&quot; for their read permission state. However, other than through
the user revoking permission, a handle retrieved from IndexedDB is also likely to resolves with
&quot;prompt&quot;.

Remarks

RequestPermission(FileSystemHandlePermissionDescriptor)

NOTE
Experimental
The requestPermission() method of the
FileSystemHandle interface requests read or readwrite permissions for the
file handle.
[Value("requestPermission")]
public Task<PermissionState> RequestPermission(FileSystemHandlePermissionDescriptor descriptor = null)

Parameters

descriptor FileSystemHandlePermissionDescriptor

Returns

Task<PermissionState>

A {{jsxref("Promise")}} that resolves with 'PermissionStatus.State' which is one of &apos;granted&apos;, &apos;denied&apos; or &apos;prompt&apos;. It may also reject with one of the exceptions below.

Remarks