MDN self-hosted library · e01.org

FileSystemHandle: isSameEntry() method

File System API

File System API

The isSameEntry() method of the FileSystemHandle interface compares two handles to see if the associated entries (either a file or directory) match.

Syntax

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 fulfills with a new array with any matching entries removed.

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

Specifications

Browser compatibility

See also