rw
Sortix rw is a program that reads blocks from the standard input and copies them to the standard output until the end of the standard input. rw(1) is designed to be a replacement for dd(1), providing only the the core blockwise I/O. It has a standard command line interface with dashed options, useful and efficient defaults, and is simpler because it doesn't support converting the input (e.g. converting ASCII to/from EBCDIC).
rw is developed as part of the Sortix operating system and comes with Sortix. rw compiles and works on at least DragonFly, Haiku, Hurd, Illumos, Linux, macOS, Midipix, Minix, NetBSD, OpenBSD, Sortix, and Windows Subsystem for Linux.
The latest version of rw is 1.0, released April 2018. The version number increments by 0.1 on every release. rw is licensed under the ISC license.
Documentation
The latest rw documentation can be found in the rw(1) Sortix manual.
Download
rw has been packaged for the following operating systems:
- Arch Linux:
pacaur -S rw
- CRUX:
prt-get install rw
(contrib repository) - DragonFly:
sysutils/rw
- FreeBSD:
pkg install rw
(FreeBSD 11.1 or earlier: You need to switch url to from/release_X
to/latest
in/etc/pkg/FreeBSD
and runpkg update
) - Gentoo:
emerge rw::pramantha
- macOS/MacPorts:
port install rw
- Midipix: rw is part of the base Midipix system
- NixOS:
tools/misc/rw
- NetBSD:
pkg_add rw
(Will appear in NetBSD 8.0 or the next quarterly pkgsrc release) - Minix:
pkg_add rw
(In the next quarterly pkgsrc release?) - OpenBSD:
pkg_add rw
(OpenBSD -CURRENT, will appear in OpenBSD 6.4) - SmartOS:
pkg_add rw
(?) (In the next quarterly pkgsrc release?) - Sortix: rw is part of the base system as of Sortix 1.1 (upcoming release)
- Source Mage:
cast rw
- Ubuntu:
add-apt-repository ppa:nortti/sortix && apt-get update && apt install rw
- Void Linux:
xbps-install -S rw
- Other systems: No known package is available, you need to compile and install the source code yourself. If you'd like to maintain a port of rw for an operating system, please let me know so I can mention it here.
Source Code
The latest rw-portable source code release is rw-portable-1.0.tar.gz.
Always verify you are viewing this page over HTTPS and that
rw-portable-1.0.tar.gz
has the correct cryptographic SHA256
hash by running:
sha256sum -c << EOF
50009730e36991dfe579716f91f4f616f5ba05ffb7bf69c03d41bf305ed93b6d rw-portable-1.0.tar.gz
EOF
Older releases can be found in the release directory. Checksums for each each release can be found in the SHA256SUM file.
Instructions on how to compile rw using make can be found in the included
README
file.
rw-portable is developed in the rw-portable gitlab repository. The latest tag is rw-portable-1.0.
The latest upstream rw source code can be found in rw/rw.c in the Sortix source code.
Differences from dd
rw is 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
-t
. - The input and output block sizes default to the preferred I/O block sizes instead of 512 bytes.
- The
-c
,-I
, and-O
options 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
-v
or-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-p
. - 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.
Known Bugs
rw is not yet able to determine the size of block devices on Illumos, Minix, NetBSD, and OpenBSD.
rw does not handle tape archives specially, as dd does on some operating systems.
rw does not support copying sparse files, a feature found on some operating systems.
rw does not work around buggy operating systems that may report the preferred IO
block size st_blksize
as 0 for some files.