Creates an instance of Entry.
ReadonlyisIndicates that this instance is an Entry. Useful for type-checking.
ReadonlyisIndicates that this instance is a file.
ReadonlyisIndicates that this instance is not a folder. Useful for type-checking.
Indicates whether this file is read-only or read-write. See readOnly and readWrite.
ReadonlynameThe name of this entry. Read-only.
ReadonlynativeThe platform native file-system path of this entry. Read-only
ReadonlyproviderThe associated provider that services this entry. Read-only.
ReadonlyurlThe url of this entry. You can use this url as input to other entities of the extension system like for eg: set as src attribute of a Image widget in UI. Read-only.
Copies this entry to the specified folder.
The folder to which to copy this entry.
Optionaloptions: { allowFolderCopy?: boolean; overwrite?: boolean }Options for the copy operation (all properties are optional)
OptionalallowFolderCopy?: booleanIf true, allows copying the folder.
Optionaloverwrite?: booleanIf true, allows overwriting existing entries.
Removes this entry from the file system. If the entry is a folder, all the contents will also be removed.
Note: Currently when using this method, a permission denied error will occur if attempting to delete a folder that was selected from a storage picker or added via drag-and-drop.
The number is 0 if succeeded, otherwise throws an Error.
Moves this entry to the target folder, optionally specifying a new name.
The folder to which to move this entry.
Optionaloptions: { newName?: string; overwrite?: boolean }Options for the move operation (all properties are optional)
OptionalnewName?: stringIf specified, the entry is renamed to this name.
Optionaloverwrite?: booleanIf true allows the move to overwrite existing files.
Reads data from the file and returns it. The file format can be specified with the format option. If a format is not supplied, the file is assumed to be a text file using UTF8 encoding.
Optionaloptions: { format?: FormatSymbol }Options for the read operation (all properties are optional)
Optionalformat?: FormatSymbolThe format of the file; see utf8 and binary.
The contents of the file.
Returns the details of the given entry like name, type and native path in a readable string format.
Writes data to a file, appending if desired. The format of the file is controlled via the format option, and defaults to UTF8.
The data to write to the file.
Optionaloptions: { append?: boolean; format?: FormatSymbol }Options for the write operation (all properties are optional)
Optionalappend?: booleanIf true, the data is written to the end of the file.
Optionalformat?: FormatSymbolThe format of the file; see utf8 and binary.
The length of the contents written to the file.
StaticisDetermines if the entry is a file or not. This is safe to use even if the entry is null or undefined.
The entry to check.
If true, the entry is a file.
Represents a file on a file system. Provides methods for reading from and writing to the file. You'll never instantiate a File directly; instead you'll get access via a storage.FileSystemProvider.
Keep in mind that
Fileas such doesn't need arequire()statement, however alocalFileSystemwill need it.See
https://developer.adobe.com/photoshop/uxp/2022/uxp-api/reference-js/Modules/uxp/Persistent%20File%20Storage/File/
Example