WebUI X Documentation
    Preparing search index...

    Interface FileInterface

    Interface representing file operations and metadata retrieval.

    interface FileInterface {
        canExecute(path: string): boolean;
        canRead(path: string): boolean;
        canWrite(path: string): boolean;
        copyTo(path: string, target: string, overwrite: boolean): boolean;
        createNewFile(path: string): boolean;
        delete(path: string): boolean;
        exists(path: string): boolean;
        isDirectory(path: string): boolean;
        isFile(path: string): boolean;
        isHidden(path: string): boolean;
        isSymLink(path: string): boolean;
        list(path: string, delimiter?: string): null | string;
        mkdir(path: string): boolean;
        mkdirs(path: string): boolean;
        read(path: string): null | string;
        readAsBase64(path: string): null | string;
        renameTo(target: string, dest: string): boolean;
        size(path: string, recursive?: boolean): number;
        stat(path: string, total?: boolean): number;
        write(path: string, data: string): void;
        writeBytes(path: string, data: number[]): void;
    }
    Index

    Methods

    • Checks if a file is executable.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      true if the file is executable, otherwise false.

    • Checks if a file is readable.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      true if the file is readable, otherwise false.

    • Checks if a file is writable.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      true if the file is writable, otherwise false.

    • Copies a file or directory to a new location.

      Parameters

      • path: string

        The source path.

      • target: string

        The destination path.

      • overwrite: boolean

        Whether to overwrite the destination if it already exists.

      Returns boolean

      true if the copy was successful, otherwise false.

    • Creates a new file.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      true if the file was created successfully, otherwise false.

    • Deletes a file or directory.

      Parameters

      • path: string

        The path to the file or directory.

      Returns boolean

      true if the deletion was successful, otherwise false.

    • Checks if a file or directory exists.

      Parameters

      • path: string

        The path to check.

      Returns boolean

      true if the file or directory exists, otherwise false.

    • Checks if a path is a directory.

      Parameters

      • path: string

        The path to check.

      Returns boolean

      true if the path is a directory, otherwise false.

    • Checks if a path is a file.

      Parameters

      • path: string

        The path to check.

      Returns boolean

      true if the path is a file, otherwise false.

    • Checks if a file is hidden.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      true if the file is hidden, otherwise false.

    • Checks if a path is a symbolic link.

      Parameters

      • path: string

        The path to check.

      Returns boolean

      true if the path is a symbolic link, otherwise false.

    • Lists the contents of a directory.

      Parameters

      • path: string

        The path to the directory.

      • Optionaldelimiter: string

        An optional delimiter for separating entries.

      Returns null | string

      A string containing the directory contents, or null if the directory cannot be read.

    • Creates a directory.

      Parameters

      • path: string

        The path to the directory.

      Returns boolean

      true if the directory was created successfully, otherwise false.

    • Creates a directory and any necessary parent directories.

      Parameters

      • path: string

        The path to the directory.

      Returns boolean

      true if the directories were created successfully, otherwise false.

    • Reads the content of a file as a string.

      Parameters

      • path: string

        The path to the file.

      Returns null | string

      The file content as a string, or null if the file cannot be read.

    • Reads the content of a file as a Base64-encoded string.

      Parameters

      • path: string

        The path to the file.

      Returns null | string

      The Base64-encoded content, or null if the file cannot be read.

    • Renames a file or directory.

      Parameters

      • target: string

        The current path of the file or directory.

      • dest: string

        The new path for the file or directory.

      Returns boolean

      true if the rename was successful, otherwise false.

    • Retrieves the size of a file or directory.

      Parameters

      • path: string

        The path to the file or directory.

      • Optionalrecursive: boolean

        Whether to include the size of subdirectories (if applicable).

      Returns number

      The size in bytes.

    • Retrieves metadata about a file or directory.

      Parameters

      • path: string

        The path to the file or directory.

      • Optionaltotal: boolean

        Whether to include additional metadata (if applicable).

      Returns number

      A numeric representation of the metadata.

    • Writes a string to a file.

      Parameters

      • path: string

        The path to the file.

      • data: string

        The string data to write.

      Returns void

    • Writes binary data to a file.

      Parameters

      • path: string

        The path to the file.

      • data: number[]

        An array of bytes to write.

      Returns void