Sortix 1.1dev nightly manual
This manual documents Sortix 1.1dev nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
|RW(1)||General Commands Manual||RW(1)|
rwreads blocks from the standard input and copies them to the standard output until the end of the standard input. The input and output block sizes default to appropriate values for efficiently reading from the input and writing to the output. Input and output will be done as aligned as possible on the block size boundaries. The final input block can be partial. Output blocks are written whenever enough input blocks have been read, or partially written whenever the end of the input is reached. The output file is not truncated after the copy is done. Byte quantities can be specified as a non-negative count of bytes in decimal format, hexadecimal format (with leading 0x), or octal format (with leading 0); optionally followed by any amount of whitespace, and then suffixed with any of the following case-insensitive suffixes that multiplies the specified quantity by that magnitude:
- Magnitude of a byte (1 byte).
- K, KiB
- Magnitude of kibibytes (1,024 bytes).
- M, MiB
- Magnitude of mebibytes (1,048,576 bytes).
- G, GiB
- Magnitude of gibibytes (1,073,741,824 bytes).
- T, TiB
- Magnitude of tebibytes (1,099,511,627,776 bytes).
- P, PiB
- Magnitude of pebibytes (1,125,899,906,842,624 bytes).
- E, EiB
- Magnitude of exbibytes (1,152,921,504,606,846,976 bytes).
- Magnitude of input blocks (the default input block size when setting block sizes).
- Magnitude of output blocks (the default output block size when setting block sizes
- Magnitude of input and output blocks (if they have the same size) (the default block size when setting block sizes).
- In combination with
-o, open the output file in append mode. This option must be used with
-oand is incompatible with
-t. The output offset is set to the size of the output file.
- Set both the input and output block sizes to the byte quantity specified by block-size.
- Stop after copying the byte quantity specified by count, in addition to stopping when the end of the input is reached. If the count starts with a leading ‘-’, stop that many bytes before the end of the input (only works if the input size is known).
- Continue as much as possible in the event of I/O errors and exit
unsuccessfully afterwards. For each input failure, skip forward to the
next input block or the next native-size input block or the end of the
file (whichever comes first), write an error to the standard error, and
replace the failed input with NUL bytes when writing it to the output. For
each output failure, skip forward to the next output block or the next
native-size output block (whichever comes first) and write an error to the
standard error. The native-size input and output blocks are those defined
by the preferred input/output size for the input and output. This option
only works for the input if it is seekable and the input size is known.
This option only works for the output if it is seekable (and
-ais not set). Beware that the default preferred input/output sizes may be larger than the underlying storage sector sizes: If this option is used, the
-woptions should be set to the appropriate input/output sector sizes, or more than just the bad sector may be skipped.
- Write statistics in the human readable format where byte amounts and time amounts are formatted according to their magnitude as described in the DIAGNOSTICS section.
- Skip past the first offset bytes in the input before the copying begins. If the offset starts with a leading ‘-’ it is interpreted as that many bytes before the end of the input (if the size is known), and if it starts with a leading ‘+’ it is interpreted as that many bytes after the end of the input (if the size is known). If the input is not seekable, the first offset bytes are read and discarded before the copying begins. If the offset is not a multiple of the input block size, the first input block is reduced in size such that it ends at an input-block-size-aligned position in the input.
- Read the input from input-file instead of the standard input.
- Seek past the first offset bytes in the
output before the copying begins. If the
offset starts with a leading
‘-’ it is interpreted as that many bytes before the end of
the output (if the size is known), and if it starts with a leading
‘+’ it is interpreted as that many bytes after the end of
the output (if the size is known). If the output is not seekable, the
number of NUL bytes specified in offset
are written to the output before the copying begins. This option cannot be
set to a non-zero value if
-ais set. If the offset is not a multiple of the output block size, the first output block is reduced in size such that it ends at a output block size aligned position in the output.
- Write the output to output-file instead
of the standard output, creating the file if it doesn't exist. If
output-file already exists, the existing
data is not discarded. Use
-tif you want to truncate the output afterwards.
- Pad the final output block with NUL bytes, such that the final output
offset (counting the initial offset with
-O) is a multiple of the output block size.
- Write occasional statistics to the standard error during the transfer and
on completion, or when being terminated by
SIGINT. period specifies the period in whole seconds at which statistics are written out. Statistics are written for every read and write if the period is zero. The format is described in the DIAGNOSTICS section.
- Set the input block size to the byte quantity specified by input-block-size.
- Sync the output on successful completion.
- Truncate the output to the final output position after the copy has
completed. This option requires the output to be truncatable. This option
is incompatible with
- Write statistics to the standard error upon completion, or when being
SIGINT. The format is described in the DIAGNOSTICS section.
- Set the output block size to the byte quantity specified by output-block-size.
- In combination with
-o, fail if the output file already exists.
-pis set, abort the copy, write statistics to the standard error, and then exit as if killed by
- Write statistics to the standard error and continue the copy. If
SIGUSR1is not ignored, this handler is installed and this signal is unblocked. To use this signal without a race condition before the signal handler is installed (as
SIGUSR1is deadly by default), block the signal before loading this program. To disable the handling of this signal, ignore the signal before loading this program.
rwwill exit 0 on success and non-zero otherwise.
rw -c 256
rw -i foo -o bar
rw -i foo -o bar -t
rw -i foo -o /dev/bar -p 10 -h -s
rw -I 512 -c 1024 -o bar -a
rw -c 2K -i foo -I 768 -o bar -O 256M
rw -r 512 -i /dev/foo -I 32r -c 4r -o bar
rw -b 4096 -c 64x -I 32x -O 65536x
rw -f -i /dev/foo -r 512 -o bar -t -p 10 -h
rw -r 512 -w 8192 -c 16384r -I 65536r -O 1048576w
rw -c 512 -I -1024 -o bar -O +2048
rw -i foo -I 100 -c -200
-pare set; occasionally if
-pis set; upon
SIGINT(if not ignored when the program was loaded) if
-vis set; and upon
SIGUSR1(if not ignored when the program was loaded). The statistics are in this format:
<time-elapsed> s <done> B / <total> B <percent>% <speed> B/s <time-left> s
7 s 714682368 B / 1238364160 B 57% 102097481 B/s 5 s
-hoption is set:
7 s 714.4 MiB / 1.1 GiB 60% 102.0 MiB/s 4 s
rworiginally appeared in Sortix 1.1.
rwis similar to dd(1), but has a distinct design and improvements:
- The command line options use the conventional option format.
- The output file is not truncated by default. One has to use
- The input and output block sizes default to the preferred I/O block sizes
instead of 512 bytes.
-Ooptions accept byte quantities by default instead of block counts, but can be specified in block counts by using the ‘r, w’, and ‘x’ suffixes.
- Statistics are not written by default. One has to use
-p. The statistics contain more useful information and is machine readable as it contains no localized information. A human readable statistics format is available using
-h. Statistics can occasionally be written out using
- There is no support for converting ASCII to EBCDIC, converting ASCII to a different EBCDIC, EBCDIC to ASCII, swapping pairs of bytes, converting the bytes to lower-case or upper-case, converting line-delimited data into fixed-size blocks, or converting fixed-sized blocks into line-delimited data.
- Offsets can be specified relative to the end of the input/output.
- Input errors stop the copying immediately rather than writing out a partial output block.
|March 6, 2018||Debian|