truncate

    Set the length of regular files using supported filesystem operations.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    13 hours ago
    Downloads
    9

    #truncate

    Set the length of regular files using supported filesystem operations.

    #Usage

    moonx cli/truncate -s 0 notes.txt moonx cli/truncate -c -s 1M data.bin

    #Common options

    OptionDescription
    -s VALUE, --size VALUESet a size or apply a signed adjustment.
    -c, --no-createSkip a missing file.
    --helpShow help.
    --versionShow the version.
    -r VALUE, --reference VALUEUse the length of a regular reference file.

    #Notes

    Zeroing and creation use filesystem open modes. Positive sizes can create or extend a regular file by writing its last byte. Shrinking an existing file to a nonzero size requires handle truncation. Growth requires exclusive access to the file while adjusting its length.

    Source Files