W3cubDocs

/Web APIs

FileSystemHandle: isSameEntry() method

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

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

js

function removeMatches(fileEntry, entriesArr) {
  let newArr = entriesArr.filter((entry) => !fileEntry.isSameEntry(entry));

  return newArr;
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
isSameEntry 86 86 111 No 72 15.2 No 86 111 61 15.2 14.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/isSameEntry