nbdkit-swab-filter(1)
π nbdkit-swab-filter β the manual, but make it cute π
okay bestie, this is nbdkit-swab-filter(1), a page from the NBDKIT manual, and it's literally the byte-order-swapping filter. sit with me, we're gonna slay this. π¦
β¨ NAME β¨
nbdkit-swab-filter β an nbdkit filter whose entire personality is swapping byte order. π
β¨ SYNOPSIS β¨
nbdkit --filter=swab PLUGIN [PLUGIN-ARGS...] [swab-bits=8|16|32|64]
β¨ DESCRIPTION β¨
So nbdkit-swab-filter is a filter for nbdkit(1) and what it does is swap bytes in the underlying plugin. That's it. That's the whole vibe. π₯
One use for this β and honestly the iconic one β is reading disk images which were formatted on the Atari Falcon, where the IDE controller is wired in reverse order. retro chaos, love that for them. π
β¨ EXAMPLE β¨
πΈ Swap bytes from a disk image πΈ
nbdkit --filter=swab file file=disk.img
The above command serves the disk image disk.img, swapping even and odd bytes:
disk.img 0 1 2 3 4 5 ...
β³ β³ β³
output 1 0 3 2 5 4 ...
look at those little crosses doing the work. πβ¨
This filter truncates the size of the plugin down to the alignment determined by swab-bits (since operating on an unaligned tail would be awkward). If you need to round the image size up instead to access the last few bytes, combine this filter with nbdkit-truncate-filter(1); fortunately, sector-based disk images are already suitably sized. π«Ά
Note that this filter fails operations where the offset or count are not aligned to the swab-bits boundaries; if you need byte-level access, apply the nbdkit-blocksize-filter(1) before this one, to get read-modify-write access to individual bytes. β οΈ
β¨ PARAMETERS β¨
swab-bits=8β This turns off the filter. bye bestie, we're done here. πswab-bits=16β This is the default setting which swaps pairs of bytes. This is suitable when reading and writing to Atari Falcon drives. πswab-bits=32β This swaps the endianness of each 4 byte word in the disk, ie:
input 0 1 2 3 4 5 6 7
output 3 2 1 0 7 6 5 4
swab-bits=64β This swaps the endianness of each 8 byte word in the disk, ie:
input 0 1 2 3 4 5 6 7
output 7 6 5 4 3 2 1 0
This can be used to make nbdkit-pattern-plugin(1) little endian instead of big endian. main character energy fr fr. π
β¨ FILES β¨
$filterdir/nbdkit-swab-filter.soβ The filter.
Use nbdkit --dump-config to find the location of $filterdir. π
β¨ VERSION β¨
nbdkit-swab-filter first appeared in nbdkit 1.22. a whole era. β
β¨ SEE ALSO β¨
nbdkit(1), nbdkit-file-plugin(1), nbdkit-pattern-plugin(1), nbdkit-filter(3), nbdkit-blocksize-filter(1). nbdkit-truncate-filter(1), nbdkit-xor-filter(1).
(yes we're keeping that stray period in the middle, it's part of the canon, no cap. π)
β¨ AUTHORS β¨
FranΓ§ois Revol π«Ά
β¨ COPYRIGHT β¨
Copyright (C) 2020 FranΓ§ois Revol
β¨ LICENSE β¨
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
okay and that's a wrap!! this page is from nbdkit-1.48.1, dated 2026-08-29, and it ate. π β¨ thanks for reading, ily, go swap some bytes responsibly π¦π
π¦ where this page comes from
- fedora 44: nbdkit-basic-filters 1.48.1-1.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms