PROPHET/OS
NAME
length: the length of a file, read and set
SYNOPSIS
length <file> [bytes|selbsttest]
DESCRIPTION
The length of a file, read and set
One question, and the build asks three foreign tools for it (R10-SELF-06): stat -c%s reads it, truncate -s sets it, and dd if=/dev/zero of=x bs=1M count=n makes a file of that length out of nothing. All three are the length of a file and nothing else, so here they are one tool.
Without a number it says the length in bytes and nothing else, so a pipe gets a number. With one it sets it, and a file that is not there is made. It says nothing on success, so a build step that only wants the room gets no line it has to throw away.
Growing writes zeros from where the file ends to where it shall end, for nobody but the writer can grow a file. Cutting this filesystem can do to nothing and to nothing else: fs_ops.kuerzen takes no length, and the call refuses any other rather than rounding it down silently. A length between nothing and what stands there is therefore refused by name, and no file is left half set.
selbsttest writes a file full, cuts it to nothing, grows it again and reads it back byte by byte: a file that grows has to grow with zeros and not with whatever lay in that place before. It is what shell.a_file_that_grows_grows_with_zeros drives.
EXAMPLE
$ length --help length <file> [bytes|selbsttest] without a number it says the length in bytes with one it sets it: what grows grows with zeros, and cutting this filesystem can do to nothing only