foo-webview-sdk
    Preparing search index...

    Interface FileWriteParams

    Parameters for file.write. Write text, or bytes decoded from Base64, to a file. Missing parent directories are created first.

    interface FileWriteParams {
        append?: boolean;
        atomic?: boolean;
        content?: string;
        encoding?: string;
        path: string;
    }
    Index
    append?: boolean

    Add to the end of the file instead of replacing its content.

    false
    
    atomic?: boolean

    Write a temporary file next to the target, flush it to disk, then replace the target with one rename: readers see the old content or the new content, never a partly written file. If the replacement fails, for example because another program has the target open, the call fails and the target keeps its old content. The temporary file is named .~<process id>-<sequence>.tmp, and its path has to fit in 259 characters as well. Cannot be combined with append; passing both fails with INVALID_PARAMS.

    false
    
    content?: string

    What to write. With encoding: "binary" a value starting with base64: is decoded and the bytes are written: characters outside the Base64 alphabet are skipped and decoding stops at the first =. Any other value, plain Base64 or a Data URL included, is written as it is. An empty string empties the file unless append is set.

    ""
    
    encoding?: string

    Only exactly binary changes anything: the file is written in binary mode and a content starting with base64: is decoded. Any other value writes text.

    "utf-8"
    
    path: string

    File to write; missing parent directories are created.