A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry below:

FileSystemDirectoryHandle: removeEntry() method - Web APIs

FileSystemDirectoryHandle: removeEntry() method

Baseline 2023

Newly available

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The removeEntry() method of the FileSystemDirectoryHandle interface attempts to remove an entry if the directory handle contains a file or directory called the name specified.

Syntax
removeEntry(name)
removeEntry(name, options)
Parameters
name

A string representing the FileSystemHandle.name of the entry you wish to remove.

options Optional

An optional object containing options, which are as follows:

recursive Optional

A boolean value, which defaults to false. When set to true entries will be removed recursively.

Return value

A Promise which resolves with undefined.

Exceptions
TypeError

Thrown if the name is not a valid string or contains characters not allowed on the file system.

NotAllowedError DOMException

Thrown if the PermissionStatus.state for the handle is not 'granted' in readwrite mode.

InvalidModificationError DOMException

Thrown if recursive is set to false and the entry to be removed has children.

NotFoundError DOMException

Thrown if the current entry is not found or if the entry of the specific name is not found or matched.

Examples

The following example removes an entry within the directory handle.

const entryName = "entryToRemove";

// assuming we have a directory handle: 'currentDirHandle'
currentDirHandle.removeEntry(entryName).then(() => {
  // code to run if removing was successful
});
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4