CV(1)
π 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:
hornβ this is the byte order situation, highkey important.his Host-specific andnis network-independent. Host format uses the native number representation and byte ordering of the machine that's runningcv(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 πββοΈsoruβ 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, anddouble, sized as on the host processor. iykyk, your mileage may literally vary by machine π«Ά8,16,32,64β explicit bit sizes, typically paired withnto 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 tohuc(host unsigned char). queen of the sensible default πout_patβ format pattern of the output data. an empty string ("") defaults tonuc(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 β π
- 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. π«Ά
π COPYRIGHT π
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
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms