FileSystemHandle: isSameEntry() method

Baseline 2023
Newly available

Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

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 isSameEntry() method of the FileSystemHandle interface compares two handles to see if the associated entries (either a file or directory) match.

Syntax

js
isSameEntry(fileSystemHandle)

Parameters

FileSystemHandle

The FileSystemHandle to match against the handle on which the method is invoked.

Return value

A Promise that fulfills with a Boolean.

Examples

The following function compares a single entry with an array of entries, and returns a Promise that fulfils with a new array with any matching entries removed.

js
async function removeMatches(fileEntry, entriesArr) {
  const newArr = [];
  for (const entry of entriesArr) {
    if (!(await fileEntry.isSameEntry(entry))) {
      newArr.push(entry);
    }
  }
  return newArr;
}

Specifications

Specification
File System
# api-filesystemhandle-issameentry

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
isSameEntry

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also