Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. FileSystemEntry
  4. isFile

FileSystemEntry: isFile property

The read-onlyisFile property oftheFileSystemEntry interface istrue if the entryrepresents a file (meaning it's aFileSystemFileEntry) andfalse if it's not.

You can also useisDirectory to determineif the entry is a directory.

Warning:You should not assume that any entry which isn't a file is a directory or vice versa.There are other types of file descriptors on many operating systems. Be sure to usebothisDirectory andisFile as needed to ensure that theentry is something you know how to work with.

Value

A Boolean indicating whether or not theFileSystemEntry is a file.

Examples

This example shows how this property might be used to determine whether to process theentry as a directory or file. If the entry is neither, an error handler is called withan appropriate message.

js
if (entry.isDirectory) {  processSubdirectory(entry);} else if (entry.isFile) {  processFile(entry);} else {  displayErrorMessage("Unsupported file system entry specified.");}

Specifications

Specification
File and Directory Entries API
# dom-filesystementry-isfile

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp