FSHelpers
Index
Constructors
constructor
Returns FSHelpers
Methods
staticcopyRecursive
Parameters
FS: FileSystemInstance
fromPath: string
toPath: string
Returns void
staticfileExists
Parameters
FS: RootFS
path: string
The file path to check.
Returns boolean
True if the file exists, false otherwise.
staticisDir
Checks if a directory exists in the PHP filesystem.
Parameters
FS: RootFS
path: string
– The path to check.
Returns boolean
True if the path is a directory, false otherwise.
staticisFile
Checks if a file exists in the PHP filesystem.
Parameters
FS: RootFS
path: string
– The path to check.
Returns boolean
True if the path is a file, false otherwise.
staticisSymlink
Checks if a path is a symlink in the PHP filesystem.
Parameters
FS: RootFS
path: string
Returns boolean
True if the path is a symlink, false otherwise.
staticlistFiles
Lists the files and directories in the given directory.
Parameters
FS: RootFS
path: string
The directory path to list.
options: ListFilesOptions = ...
Options for the listing.
Returns string[]
The list of files and directories in the given directory.
staticmkdir
Recursively creates a directory with the given path in the PHP filesystem. For example, if the path is
/root/php/data
, and/root
already exists, it will create the directories/root/php
and/root/php/data
.Parameters
FS: RootFS
path: string
The directory path to create.
Returns void
staticmv
Moves a file or directory in the PHP filesystem to a new location.
Parameters
FS: RootFS
fromPath: string
The path to rename.
toPath: string
The new path.
Returns void
staticreadFileAsBuffer
Reads a file from the PHP filesystem and returns it as an array buffer.
Parameters
FS: RootFS
path: string
The file path to read.
Returns Uint8Array
The file contents.
staticreadFileAsText
Reads a file from the PHP filesystem and returns it as a string.
Parameters
FS: RootFS
path: string
The file path to read.
Returns string
The file contents.
staticreadlink
Reads the target of a symlink in the PHP filesystem.
Parameters
FS: RootFS
path: string
Returns string
The target of the symlink.
staticrealpath
Gets the real path of a file in the PHP filesystem.
Parameters
FS: RootFS
path: string
Returns string
The real path of the file.
staticrmdir
Removes a directory from the PHP filesystem.
Parameters
FS: RootFS
path: string
The directory path to remove.
options: RmDirOptions = ...
Options for the removal.
Returns void
staticsymlink
Creates a symlink in the PHP filesystem.
Parameters
FS: RootFS
target: string
link: string
Returns any
staticunlink
Removes a file from the PHP filesystem.
Parameters
FS: RootFS
path: string
The file path to remove.
Returns void
staticwriteFile
Overwrites data in a file in the PHP filesystem. Creates a new file if one doesn’t exist yet.
Parameters
FS: RootFS
path: string
The file path to write to.
data: string | Uint8Array
The data to write to the file.
Returns void
Checks if a file (or a directory) exists in the PHP filesystem.