CV(1)

πŸ“¦
version 7.44.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… cv(1) β€” the BRL-CAD glow-up page πŸ¦‹

okay bestie, welcome to cv(1), straight out of the BRL-CAD manual set. yes she's a section-1 command, yes she's iconic, and yes we're gonna learn her together πŸ’–


✨ NAME ✨

cv β€” the way she converts binary data files between representation formats. periodt. πŸŽ€


🌸 SYNOPSIS 🌸

cv in_pat out_pat [[infile] outfile]

like… that's it. that's the whole vibe. two pattern besties and optionally some files. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: cv takes a whole stream of binary numbers and converts them from one representation (we call that a format) to another. she reads from infile and writes the converted result to outfile. main character energy, honestly.

each format gets described by a short pattern β€” and listen, no embedded blanks, bestie, not even one πŸ‘€ β€” drawn from the choices:

[h|n][s|u][c|s|i|l|d|8|16|32|64]

here's the breakdown, no cap:

  • h or n β€” this is the byte order situation, highkey important. h is Host-specific and n is network-independent. Host format uses the native number representation and byte ordering of the machine that's running cv (so like, her machine, not yours). Network format is big-endian, two's complement; network doubles are 64-bit IEEE 754 in big-endian order. and if you just… omit it? network format is assumed. she's got a default, she's decisive πŸ’β€β™€οΈ
  • s or u β€” Signed (s) or unsigned (u) integer. and ngl? this flag has no effect on the double-precision format. it said "not my department" 😭
  • c, s, i, l, d β€” the C language types: char, short, int, long, and double, sized as on the host processor. iykyk, your mileage may literally vary by machine 🫢
  • 8, 16, 32, 64 β€” explicit bit sizes, typically paired with n to specify exact data sizes regardless of host word length. this is the "i don't care what machine you're on, i want exactly this many bits" move πŸ”₯

for example, hui is a host unsigned int and nl is a network (signed) long. see? the pattern grammar ate, honestly πŸ‘‘

🚨 and one very real thing: cv refuses to send binary output to a terminal. she will not do it. she's protecting you. don't fight her πŸ’€

πŸ’œ OPTIONS πŸ’œ

  • in_pat β€” format pattern of the input data. an empty string ("") defaults to huc (host unsigned char). queen of the sensible default πŸ’–
  • out_pat β€” format pattern of the output data. an empty string ("") defaults to nuc (network unsigned char). ✨
  • infile β€” the file to read input from. when both infile and outfile are given, this is the first filename; with a single filename it's the input and the output goes to standard output. and if it's omitted entirely? standard input is used, bestie 🌈
  • outfile β€” the file to write the converted data to. she's only present when two filenames are supplied; otherwise output goes to standard output. she's exclusive like that πŸ™ˆ

πŸŽ€ EXAMPLES πŸŽ€

⭐ Example 1. Convert host signed shorts to network 32-bit integers

cv hss n32 data.short data.net

reads the binary file data.short of machine-specific signed shorts and writes network-independent 32-bit integers to data.net β€” producing a portable file that can be read identically on any platform. the way that's literally the whole point bestie, cross-platform queen πŸ‘‘

πŸ“ Example 2. Repack network doubles as host doubles in a pipeline

cat data.nd | cv nd hd > data.hd

reads network-independent double-precision floats from standard input and emits host-native doubles on standard output β€” the typical first step before feeding the values to a program that expects local byte order. pipeline girly behavior, we love her 🌸


🌈 SEE ALSO 🌈

brlcad(1), dpix-pix(1), pix-bw(1), bw-pix(1)

and also, the academic moment β€” πŸŽ“

  1. J. Muuss, Workstations, Networking, Distributed Graphics, and Parallel Processing in Computer Graphics Techniques: Theory and Practice, edited by D. F. Rogers, R. A. Earnshaw, Springer-Verlag, 1990

πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” the collective. the whole squad. 🫢


This software is Copyright (c) 1991-2026 by the United States Government as represented by U.S. Army Research Laboratory.

like… legally speaking, that's the vibe πŸ’–


🧚 BUG REPORTS 🧚

found a bug? a problem? something acting sus? reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β€” they literally want to hear from you, don't be shy 😭


ngl that's the whole page, bestie. now go convert some binary and slay ✨

okay bye, this page came from the BRL-CAD manual collection β€” it's cv(1), and the copyright run says 1991–2026 β€” see you in the group chat πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from