WebUI X Documentation
    Preparing search index...

    Interface FileSystemInstance

    Defines an interface representing an instance of a file or directory. The methods operate directly on the path associated with this instance. All operations are synchronous and will block execution until they complete.

    interface FileSystemInstance {
        canExecuteSync(): boolean;
        canReadSync(): boolean;
        canWriteSync(): boolean;
        chmodSync(mode: number): boolean;
        chownSync(uid: number, gid: number): boolean;
        copyFileSync(dest: string): void;
        copyFileSync(dest: string, overwrite: boolean): void;
        createNewFileSync(): boolean;
        existsSync(): boolean;
        isBlockSync(): boolean;
        isCharacterSync(): boolean;
        isDirectorySync(): boolean;
        isFileSync(): boolean;
        isHiddenSync(): boolean;
        isNamedPipeSync(): boolean;
        isSocketSync(): boolean;
        isSymlinkSync(): boolean;
        listSync(): null | string;
        listSync(delimiter: string): null | string;
        mkdirsSync(): boolean;
        mkdirSync(): boolean;
        readTextSync(): null | string;
        renameSync(newPath: string): boolean;
        rmSync(): boolean;
        sizeSync(): null | number;
        statSync(): null | number;
        writeTextSync(text: string): null | void;
    }
    Index

    Methods

    • Checks if the application can execute the file of this instance.

      Returns boolean

      true if executable, false otherwise.

    • Checks if the application can read the file of this instance.

      Returns boolean

      true if readable, false otherwise.

    • Checks if the application can write to the file of this instance.

      Returns boolean

      true if writable, false otherwise.

    • Changes the permissions of the file or directory (e.g., using octal notation).

      Parameters

      • mode: number

        The permission mode.

      Returns boolean

      true on success, false otherwise.

    • Changes the owner and group of the file or directory.

      Parameters

      • uid: number

        The user ID.

      • gid: number

        The group ID.

      Returns boolean

      true on success, false otherwise.

    • Copies the file of this instance to a new destination.

      Parameters

      • dest: string

        The destination file path.

      Returns void

    • Parameters

      • dest: string
      • overwrite: boolean

      Returns void

    • Creates a new, empty file at the path of this instance.

      Returns boolean

      true if the file was created, false if it already exists.

    • Checks if the file or directory of this instance exists.

      Returns boolean

      true if it exists, false otherwise.

    • Checks if this instance points to a block device.

      Returns boolean

      true if it is a block device, false otherwise.

    • Checks if this instance points to a character device.

      Returns boolean

      true if it is a character device, false otherwise.

    • Checks if this instance represents a directory.

      Returns boolean

      true if it is a directory, false otherwise.

    • Checks if this instance represents a regular file.

      Returns boolean

      true if it is a file, false otherwise.

    • Checks if the file or directory of this instance is hidden.

      Returns boolean

      true if it is hidden, false otherwise.

    • Checks if this instance points to a named pipe (FIFO).

      Returns boolean

      true if it is a named pipe, false otherwise.

    • Checks if this instance points to a socket.

      Returns boolean

      true if it is a socket, false otherwise.

    • Checks if this instance represents a symbolic link.

      Returns boolean

      true if it is a symbolic link, false otherwise.

    • Lists the files and directories if this instance represents a directory.

      Returns null | string

      A string containing the names of the items in the directory, or null if this instance is not a directory.

    • Parameters

      • delimiter: string

      Returns null | string

    • Creates a directory at the path of this instance, including parent directories.

      Returns boolean

      true on success, false otherwise.

    • Creates a directory at the path of this instance.

      Returns boolean

      true on success, false otherwise.

    • Reads the entire content of the file associated with this instance.

      Returns null | string

      The content of the file as a UTF-8 string, or null if reading fails.

    • Renames or moves the file or directory of this instance.

      Parameters

      • newPath: string

        The new path for the file or directory.

      Returns boolean

      true on success, false otherwise.

    • Removes the file or directory of this instance.

      Returns boolean

      true on success, false otherwise.

    • Returns the size of the file of this instance in bytes.

      Returns null | number

      The size in bytes, or null if it's not a file.

    • Retrieves status information about the file of this instance.

      Returns null | number

      The last modification time (e.g., in milliseconds since epoch), or null on failure.

    • Writes a string to the file associated with this instance.

      Parameters

      • text: string

        The content to write.

      Returns null | void

      Returns null if the operation fails.