8.6 Released with 🥽 visionOS support and more!
Check it out
FileSystemEntity
Represents a single entity on the file system.

Summary

Constructors

constructor

new FileSystemEntity(): FileSystemEntity

Properties

lastModified

lastModified: Date
Gets the Date object specifying the last time this entity was modified.

name

name: string
Gets the name of the entity.

parent

parent: Folder
Gets the Folder object representing the parent of this entity. Will be null for a root folder like Documents or Temporary. This property is readonly.

path

path: string
Gets the fully-qualified path (including the extension for a File) of the entity.

Methods

remove

remove(): Promise<any>
Removes (deletes) the current Entity from the file system.
Returns Promise<any>

removeSync

removeSync(onError?: (error: any) => any): void
Removes (deletes) the current Entity from the file system synchronously.
Parameter Default Description
onError
(error: any) => any

Returns void

rename

rename(newName: string): Promise&lt;any&gt;
Renames the current entity using the specified name.
Parameter Default Description
newName
string

The new name to be applied to the entity.

Returns Promise<any>

renameSync

renameSync(newName: string, onError?: (error: any) => any): void
Renames the current entity synchronously, using the specified name.
Parameter Default Description
newName
string

The new name to be applied to the entity.

onError
(error: any) => any

Returns void
Previous
File