BAR(1)
๐ BAR(1) ๐ โ okay so this is the manual for bar, from the General Commands Manual section, and bestie, it's a whole vibe ๐ฆ
โจ NAME โจ
bar โ show information about a data transfer ๐
๐ธ SYNOPSIS ๐ธ
bar [ I/O-options ] [ display-options ] [ color-options ]
[ input-file ] [ output-file ]
[ -h | --help ] [ -v | --version ]
๐ DESCRIPTION ๐
Bar is a simple tool that processes a stream of data and prints a display for you on stderr showing:
- (a) the amount of data passed ๐ฆ
- (b) the throughput of the data transfer ๐
- (c) and if the total size of the data stream is known โ estimated time remaining, percent complete, and a progress bar โณ
Bar was originally written for the purpose of estimating the amount of time needed to transfer large amounts (many, many gigabytes) of data across a network. (Usually in an SSH/tar pipe.) Like, that was the entire origin story. Iconic. ๐ง
๐ I/O COMMAND LINE OPTIONS ๐
-ifinput-file--in-fileinput-file
Read input from input-file. Default: stdin
-ofoutput-file--out-fileoutput-file
Write output to output-file. If the output file is a directory, then bar will attempt to create a file in the output directory with the same name as the input file, and attempt to copy the input file mode as well as it's data. Default: stdout
Please notice that if no -if, --in-file, -of, or --out-file options are specified on the command line, and an unknown command line option is encountered, then bar will assume that the first unknown command line option is a path to an input file, and the second (if found) is a path to an output file. ๐ (yes really, it just guesses, iykyk)
-ssize--sizesize
Expect an input stream of size bytes. ๐
When reading a regular file or a link to a regular file, bar will extract the file size on it's own. However, this flag is useful for reading from a character- or block-special device file, or from a pipe. size may be followed by 'k', 'm', 'g', 't', 'p', or 'e' for kilobytes, megabytes, gigabytes, terabytes, petabytes, or exabytes, respectively (see also the -k option below). Alternatively, size may also be specified in terms of 'b' for blocks (see the -bl option below). See examples below.
-csize--completedsize
Instruct bar that size bytes of the data stream have already been copied, and that this is a continuation of a previous data stream. Note that use of this option will throw off throughput and ETA calculations at first, but they should settle down as the transfer continues. (she's just a little confused at first, give her a sec ๐ซถ)
-bsbuffer-size--buffer-sizebuffer-size
Allocate an I/O buffer of buffer-size bytes. The same modifiers may apply here ('k', 'm', 'g', 't', 'p', 'e' and 'b') as for the -s flag above. Changing the buffer size can improve throughput, depending on your application of bar. For fast I/O operations, say from a ramdisk for instance, it might be worth your while to experiment with a large buffer (circa 1MB for instance). But for slow I/O operations, like from a tape drive, you could merely be wasting your memory. Default: 52488 (512KB)
-thrate--throttlerate
Restrict I/O throughput to rate bytes per second. The same modifiers apply here ('k', 'm', 'g', 't', 'p', 'e' and 'b') as for the -s flag above. ๐ข
-iseconds--intervalseconds
Update the display every seconds seconds. Default: 1 second โฐ
-tmicroseconds--timeoutmicroseconds
The number of microseconds to wait for a change in I/O state before select() times out. Default: 250000 (1/4 second)
-k1000|1024--kilo1000|1024
Use either 1000 or 1024 as the definition of a kilobyte. Default: 1024 ๐งฎ
-blsize--block-sizesize
When reading sizes from the command line that are specified in terms of blocks, assume a single block is size bytes. Size may be followed by 'k', 'm', 'g', 't', 'p', or 'e' for kilobytes, megabytes, gigabytes, terabytes, petabytes, or exabytes, respectively. Block size must be set before specifying any sizes in terms of blocks or the default value will be used instead. Specifying size in terms of 'b' for blocks is not allowed for this option. Default: 512
๐ DISPLAY COMMAND LINE OPTIONS ๐
-swwidth--screen-widthwidth
Assume a screen width of width characters. ๐
Bar will attempt to retrieve the width of the terminal it is running on, and will adjust that width if the terminal is resized. If bar cannot determine the terminal width, then bar will assume a default width of 79 characters. Use the --screen-width command line option to override this behavior and specify a fixed width for bar to use. (When this option is used, bar will ignore terminal resized signals and continue to use the value provided by the user.) โ she's locked in, no take-backs ๐
-sw-1|--screen-width-minus-one-sw-0|--screen-width-minus-zero
Instruct bar to use either the entire column width reported by termio, or one less than reported by termio. I.e. If termio reports that you are running bar in a terminal that's 80 characters wide, using the command line option --screen-width-minus-one instructs bar to only use 79 characters to print the display. If you're using a terminal or shell that wraps the line whenever bar prints the last character then this should alleviate that problem. Default is to use the full terminal's width.
-shheight--screen-heightheight
Assume a screen height of height characters. ๐
Bar will attempt to retrieve the height of the terminal it is running on, and will adjust that height if the terminal is resized. If bar cannot determine the terminal height, then bar will assume a default height of 23 characters. Use the --screen-height command line option to override this behavior and specify a fixed height for bar to use. (When this option is used, bar will ignore terminal resized signals and continue to use the value provided by the user.)
Please note that this option is only useful when used in conjunction with the --info-file command line option. Otherwise bar has no need to know the screen height in order to perform it's function.
-sh-1|--screen-height-minus-one-sh-0|--screen-height-minus-zero
Instruct bar to use either the entire row height reported by termio, or one less than reported by termio. I.e. If termio reports that you are running bar in a terminal that's 24 rows characters high, using the command line option --screen-height-minus-one instructs bar to only use 23 rows to print the display. If you're using a terminal or shell that wraps the line whenever bar prints the last character then this should alleviate that problem. Default is to use the full terminal's height.
Please note that this option is only useful when used in conjunction with the --info-file command line option. Otherwise bar has no need to know the screen height in order to perform it's function.
-tistring |--titlestring
Set the title to string. ๐
-dti|-nti--display-title|--no-title
Turn on/off the title display. Even if on, if no title string is set then no title will be displayed. Default is on.
-dtw|--display-twiddle-ntw|--no-twiddle
Turn on/off the twiddle in the display. (the lil spinner bestie, she's doing her best ๐)
-dc|--display-count-nc|--no-count
Turn on/off the data count in the display. Default is on.
-dcb|-ncb--display-count-bits|--no-count-bits
Display the data count at bits instead of as bytes. Default is off.
By default bar will display the data count as bytes using the notation of "B". Using this option, bar will display the throughput as bits using the notation of "b".
-dth|--display-throughput-nth|--no-throughput
Turn on/off the data throughput in the display. Default is on. ๐
-dthb|-nthb--display-throughput-bits|--no-throughput-bits
Display throughput as bits/second instead of as bytes/second. Default is off.
By default bar will display the throughput as bytes/second using the notation of "B/s". Using this option, bar will display the throughput as bits/second using the notation of "b/s".
-dt|--display-time-nt|--no-time
Turn on/off the time elapsed or eta in the display. Default is on. โณ
-de|--display-elapsed-only-ne|--no-elapsed-only
Force bar to display the elapsed time instead of the eta. Default is off.
-dp|--display-percent-np|--no-percent
Turn on/off percent complete in the display. Default is on. ๐ฏ
-db|--display-bar-nb|--no-bar
Turn on/off the progress bar in the display. Default is on.
-ds|--display-summary-ns|--no-summary
Turn on/off the summary information displayed when the operation is complete. Default is on.
-da|--display-all-dn|--display-none
Turn on/off all displays. -dn is equivalent to -ntw -nc -nth -nt -np -nb. (Using -dn followed by -db would be equivalent to -ntw -nc -nth -nt -np.) -da is equivalent to -dtw -dc -dth -dt -dp -db. โจ
-infinfofile |--info-fileinfofile
Display the information contained in infofile while copying data. The file infofile is a regular text file containing tidbits of information broken up into sections. Each section is separated by a line containing the string "@@@" by itself, with no other characters on the line, either preceeding or following.
When bar begins, it will count the number of sections within the file. Bar will then begin by displaying the first section of information to the display before it draws the status line. Then, periodically, each of the successive sections will be displayed as the progress indicator fills up.
The progress of the data transfer is the trigger for each successive display. For instance, if your information file has exactly four sections to it, then the first section will be printed as bar begins, the second section after the data transfer hits 25%, the third at 50%, and the fourth at 75%. ๐
If bar is configured to use ANSI control codes, then the screen will be cleared before printing a section from the information file. Otherwise, the contents of the current screen are scolled up and off the screen.
-dnum|--display-numeric
Do not render the usual display, but instead display an integer representing the percent of the transfer that is complete, one integer per line. This output is suitable for piping to other programs such as dialog(1) or zenity(1). This implies that the total transfer size must be known by bar, either by finding the size of an input file directly or by using the --size command line option.
-dw|--display-wait
Wait for the first byte of data to come through before displaying anything. ๐ซฃ
๐ COLOR COMMAND LINE OPTIONS ๐
okay bestie, this is the part where bar goes full glam ๐ every color option down here takes a color name, and the vibes committee has approved exactly these keywords:
normal, black, red, green, yellow, blue, magenta, cyan, and white
that's the whole list. no "hot pink", no "slime green", no "whatever that color is in the sunset". just those nine. memorise them, they come back like a hundred times ๐ซถ
-dan,--display-ansiโ turns on the use of ansi color codes in the display โจ-nan,--no-ansiโ turns them off ๐ (yeah,-nanis "no ansi", not "nan" like the math thing, we've all been there)
-spbgcolor,--space-backgroundcolor โ sets color as the background color for the spacing between display objects ๐ default:normal
-twfgcolor,--twiddle-foregroundcolor โ sets color as the twiddle color in the display ๐ฅ-twbgcolor,--twiddle-backgroundcolor โ same deal, twiddle color. default:normal
-twb,--twiddle-boldโ turns on bold font for the twiddle ๐-twn,--twiddle-normalโ turns it off. default off
-tifgcolor,--title-foregroundcolor โ sets color as the title color in the display ๐-tibgcolor,--title-backgroundcolor โ title color again. default:normal
-tib,--title-boldโ turns on bold font for the title, main character energy fr fr โญ-tin,--title-normalโ turns it off. default off
-cfgcolor,--count-foregroundcolor โ sets color as the data count color in the display ๐ข-cbgcolor,--count-backgroundcolor โ data count color. default:normal
-cb,--count-boldโ turns on bold font for the data count ๐ช-cn,--count-normalโ turns it off. default off
-thlfgcolor,--throughput-label-foregroundcolor โ sets color as the throughput label color in the display ๐ธ-thlbgcolor,--throughput-label-backgroundcolor โ throughput label color. default:normal
-thlb,--throughput-label-boldโ turns on bold font for the throughput label โจ-thln,--throughput-label-normalโ turns it off. default off
-thfgcolor,--throughput-foregroundcolor โ sets color as the throughput color in the display ๐-thbgcolor,--throughput-backgroundcolor โ throughput color. default:normal
-thb,--throughput-boldโ turns on bold font for the throughput ๐ฅ-thn,--throughput-normalโ turns it off. default off
-tlfgcolor,--time-label-foregroundcolor โ sets color as the time label color in the display โฐ-tlbgcolor,--time-label-backgroundcolor โ time label color. default:normal
-tlb,--time-label-boldโ turns on bold font for the time label ๐-tln,--time-label-normalโ turns it off. default off
-tfgcolor,--time-foregroundcolor โ sets color as the time color in the display ๐-tbgcolor,--time-backgroundcolor โ time color. default:normal
-tb,--time-boldโ turns on bold font for the time ๐-tn,--time-normalโ turns it off. default off
-pfgcolor,--percent-foregroundcolor โ sets color as the percent color in the display ๐ฏ-pbgcolor,--percent-backgroundcolor โ percent color. default:normal
-pb,--percent-boldโ turns on bold font for the percent ๐-pn,--percent-normalโ turns it off. default off
-bbfgcolor,--bar-brace-foregroundcolor โ sets color as the brace color around the progress bar in the display ๐ฆ-bbbgcolor,--bar-brace-backgroundcolor โ bar brace color. default:normal
-bbb,--bar-brace-boldโ turns on bold font for the bar braces โจ-bbn,--bar-brace-normalโ turns it off. default off
-bfgcolor,--bar-foregroundcolor โ sets color as the color of the progress bar in the display ๐-bbgcolor,--bar-backgroundcolor โ progress bar color. default:normal
-bb,--bar-boldโ turns on bold font for the progress bar ๐ฅ-bn,--bar-normalโ turns it off. default off
okay now we get to the actual characters of the bar, like the literal glyphs, and you get to pick them:
-bobcchar,--bar-openbrace-charchar โ sets char as the open brace character on the progress bar ๐ซถ-bcbcchar,--bar-closebrace-charchar โ sets char as the close brace character on the progress bar ๐ซถ-bccchar,--bar-complete-charchar โ sets char as the completed character on the progress bar โ-bicchar,--bar-incomplete-charchar โ sets char as the incomplete character on the progress bar โฌ
and the last two, the classics:
-h,--helpโ displays this text and exits ๐ (yes, this text. the one you're reading. hi ๐)-v,--versionโ displays the program version and exits ๐ท๏ธ
๐ RESOURCE FILE OPTIONS ๐
okay bestie so listen โ you don't have to type out every single flag on the command line every time like some kind of peasant. some of them can live in a resource file, and honestly? iconic behavior. ๐
here's the search order, and it's a whole vibe:
bar looks for a resource file named /etc/clpbarrc first, and if it finds one, bar uses those values by default. then bar goes looking for ~/.barrc, and if that one exists, its values override anything set in /etc/clpbarrc. and last? bar checks the current working directory for a file called ./.barrc. if that exists, its values override everything from ~/.barrc or /etc/clpbarrc. so it's giving very much โจ layered โจ.
and guess what โ values in all of those files can still get overridden by command line flags, because command line flags are the main character here. ๐
oh and ps: lines that begin with a # are ignored. comment your little heart out, queen. ๐
๐ฆ boolean values, fr fr
for resource options that want a boolean, the following values are recognized:
onandoffyesandno, (and the single-character abbreviationsyandn)trueandfalse, (and the single-character abbreviationstandf)0and1
๐ color values
for resource options that want a color, the same keywords are recognized as for the color-specific command line options above: normal, black, red, green, yellow, blue, magenta, cyan, and white
๐ธ the options themselves, bestie
buffer-size: buffer-sizeโ allocate an I/O buffer ofbuffer-sizebytes. see the--buffer-sizecommand line option above. ๐ซถthrottle: rateโ restrict I/O throughput toratebytes per second. see the--throttlecommand line option above. slow and steady, bestie. ๐ขinterval: secondsโ update the display everysecondsseconds. see the--intervalcommand line option above. โฐtimeout: microsecondsโ the number ofmicrosecondsto wait for a change in I/O state beforeselect()times out. see the--timeoutcommand line option above.kilobyte: 1000|1024โ use either1000or1024as the definition of a kilobyte. see the--kilocommand line option above.block-size: sizeโ when parsing sizes specified in terms of blocks, assume a single block issizebytes. see the--block-sizecommand line option above.screen-width: widthโ override termio and assume that the screen iswidthcharacters wide. see the--screen-widthcommand line option above.screen-width-minus-one: booleanโ instruct bar to restrict the number of columns reported by termio by one. see the--screen-width-minus-onecommand line option above.display-twiddle: booleanโ instruct bar to turn on/off the twirling twiddle character in the display. see the--display-twiddlecommand line option above. it spins. it twirls. it slays. โจdisplay-title: booleanโ instruct bar to turn on/off the title in the display. see the--display-titlecommand line option above.display-count: booleanโ instruct bar to turn on/off the data count in the display. see the--display-countcommand line option above.display-count-bits: booleanโ display the data count as bits instead of as bytes. see the--display-count-bitscommand line option above.display-throughput: booleanโ instruct bar to turn on/off the data throughput in the display. see the--display-throughputcommand line option above.display-throughput-bits: booleanโ display throughput as bits/sec instead of as bytes/sec. see the--display-throughput-bitscommand line option above.display-time: booleanโ instruct bar to turn on/off the time in the display. see the--display-timecommand line option above.display-elapsed-only: booleanโ force bar to display the elapsed time instead of the eta. see the--display-elapsed-onlycommand line option above.display-percent: booleanโ instruct bar to turn on/off the percent complete in the display. see the--display-percentcommand line option above.display-bar: booleanโ instruct bar to turn on/off the progress bar in the display. see the--display-barcommand line option above.display-summary: booleanโ instruct bar to turn on/off the summary information displayed when operation is complete. see the--display-summarycommand line option above.
๐ info-file: infofile
display the information contained in infofile while copying data. the file infofile is a regular text file containing tidbits of information broken up into sections. each section is separated by a line containing the string "@@@" by itself, with no other characters on the line, either preceeding or following. ๐
when bar begins, it will count the number of sections within the file. bar will then begin by displaying the first section of information to the display before it draws the status line. then, periodically, each of the successive sections will be displayed as the progress indicator fills up.
the progress of the data transfer is the trigger for each successive display. for instance, if your information file has exactly four sections to it, then the first section will be printed as bar begins, the second section after the data transfer hits 25%, the third at 50%, and the fourth at 75%. math girlie behavior, honestly. ๐งฎ
if bar is configured to use ANSI control codes, then the screen will be cleared before printing a section from the information file. otherwise, the contents of the current screen are scolled up and off the screen.
๐ display-numeric: boolean
do not render the usual display, but instead display an integer representing the percent of the transfer that is complete, one integer per line. this output is suitable for piping to other programs such as dialog(1) or zenity(1). this implies that the total transfer size must be known by bar, either by finding the size of an input file directly or by using the --size command line option.
๐ display-wait: boolean
wait for the first byte of data to come through before displaying anything. patience is a virtue, bestie. ๐
๐ display-ansi: boolean
instruct bar to turn on/off the use of ansi color codes in the display. see the --display-ansi command line option above.
๐ space-background: color
use color as the background color for spacing between display objects. see the --space-background command line option above.
๐ twiddle colors
twiddle-foreground: colortwiddle-background: colortwiddle-bold: boolean
use the specified colors for the foreground and background of the twiddle, and use a bold font. see the --twiddle-foreground, --twiddle-background, and --twiddle-bold command line options above. ๐
๐ title colors
title: stringโ set the title string for the display. see the--titlecommand line option above.title-foreground: colortitle-background: colortitle-bold: boolean
use the specified colors for the foreground and background of the title, and use a bold font. see the --title-foreground, --title-background, and --title-bold command line options above.
๐ count colors
count-foreground: colorcount-background: colorcount-bold: boolean
use the specified colors for the foreground and background of the data count, and use a bold font. see the --count-foreground, --count-background, and --count-bold command line options above.
๐ throughput-label colors
throughput-label-foreground: colorthroughput-label-background: colorthroughput-label-bold: boolean
use the specified colors for the foreground and background of the throughput label, and use a bold font. see the --throughput-label-foreground, --throughput-label-background, and --throughput-label-bold command line options above.
๐ throughput colors
throughput-foreground: colorthroughput-background: colorthroughput-bold: boolean
use the specified colors for the foreground and background of the throughput, and use a bold font. see the --throughput-foreground, --throughput-background, and --throughput-bold command line options above.
๐ time-label colors
time-label-foreground: colortime-label-background: colortime-label-bold: boolean
use the specified colors for the foreground and background of the time label, and use a bold font. see the --time-label-foreground, --time-label-background, and --time-label-bold command line options above.
๐ time colors
time-foreground: colortime-background: colortime-bold: boolean
use the specified colors for the foreground and background of the time, and use a bold font. see the --time-foreground, --time-background, and --time-bold command line options above.
๐ percent colors
percent-foreground: colorpercent-background: colorpercent-bold: boolean
use the specified colors for the foreground and background of the percent, and use a bold font. see the --percent-foreground, --percent-background, and --percent-bold command line options above.
๐ bar-brace colors
bar-brace-foreground: colorbar-brace-background: colorbar-brace-bold: boolean
use the specified colors for the foreground and background of the brace surrounding the progress bar, and use a bold font. see the --bar-brace-foreground, --bar-brace-background, and --bar-brace-bold command line options above.
๐ bar colors
bar-foreground: colorbar-background: colorbar-bold: boolean
use the specified colors for the foreground and background of the progress bar, and use a bold font. see the --bar-foreground, --bar-background, and --bar-bold command line options above.
๐ custom bar characters, yesss
bar-openbrace-char: charbar-closebrace-char: charbar-complete-char: charbar-incomplete-char:
use the specified custom characters char for the opening brace, closing brace, completed, and incomplete characters when rendering the progress bar. make it yours, bestie. ๐ฆ
โจ EXAMPLES โจ
okay bestie, this is the part where it all clicks ๐ real-world scenarios, all of them, let's go.
Example 1
Using bar to copy a 2.4gb file from a device (in this case a tape drive) to a file, using a 64k buffer.
prompt% bar --in-file /dev/rmt/1cbn --out-file \
tape-restore.tar --size 2.4g --buffer-size 64k
Example 2
Using bar to copy a 37tb file across the network using SSH.
prompt% ssh remote 'dd if=file' | bar --size 37t > file
Example 3
Using bar inside a tar-pipe command.
A normal tar-pipe command might be:
prompt% (cd /some/dir/somewhere && tar -cf - *) \
| (cd /some/other/dir && tar -xBpf -)
3a: Using bar within the tar-pipe:
prompt% (cd /some/dir/somewhere && tar -cf - *) \
| bar \
| (cd /some/other/dir && tar -xBpf -)
3b: Using bar with the --size option in a tar-pipe:
prompt% du -sk /some/dir/somewhere
6281954 /some/dir/somewhere
prompt% (cd /some/dir/somewhere && tar -cf - *) \
| bar --size 6281954k \
| (cd /some/other/dir && tar -xBpf -)
Example 4
Using bar on a regular file. (Note that the --size option is not needed here, as bar will retrieve the file size itself.)
prompt% bar --in-file ./file | ssh remote 'cd /some/dir && dd of=file'
Example 5
Generating a 512k file of random data.
prompt% dd if=/dev/random bs=1024 count=512 \
| bar -s 512k -of ./random
Example 6
An example .barrc file. ๐
#
# This is an example of what a ~/.barrc file
# might look like. Note that lines beginning
# with a # are ignored.
#
display-twiddle: no
display-ansi: yes
# space-background: black
twiddle-foreground: green
# twiddle-background: normal
# twiddle-bold: no
count-foreground: green
# count-background: magenta
count-bold: yes
throughput-label-foreground: normal
# throughput-label-background: red
throughput-label-bold: no
throughput-foreground: green
# throughput-background: black
throughput-bold: yes
time-label-foreground: normal
# time-label-background: red
time-label-bold: no
time-foreground: green
# time-background: black
time-bold: yes
percent-foreground: green
# percent-background: green
percent-bold: yes
bar-brace-foreground: red
# bar-brace-background: blue
bar-brace-bold: no
bar-foreground: yellow
# bar-background: blue
bar-bold: yes
๐ธ NOTES ๐ธ
- The
--sizeoption is only used bybarin calculating information about the data transfer.barwill not cease copying data once it has reached the number of bytes specified with the--sizeoption โ insteadbarwill continue to copy data until an end of input is reached. If this behavior is undesirable thenbarmay be used in conjunction withdd, where thecountoption is used withddto specify when to cut off the input stream. (See examples above.) - When using other commands such as
du -kto calculate the expected size of a data transfer stream, the value returned may not be exactly the number of bytes counted bybarin the actual data transfer. Common causes for this discrepancy could be attributed to round-off error or the use of1000bytes as a kilobyte rather than1024. (If the latter is the case, then using the-k 1000option tobarwill help.) When such discrepancies occur,barmay report that the data stream contained only98%or as much as101%of it's expected size. (If you have doubts, you should definitely verify your data usingmd5sum,diff, orcmp.) ๐ do not skip that part, bestie, fr fr. - When the value of a calculation exceeds the size alloted for the display, the value
+99...will be substituted in it's place. The complete value will be displayed in a summary statement afterbarhas reached the end of input. Barassumes a linear relationship between the speed of the data transfer and the amount of time remaining. Specifically the calculation is based on the following:
elapsed time / eta = bytes written / total size
However, it has been the author's experience that the throughput speed will change, particularly at the beginning of the transfer, and this will affect the estimated time remaining. The author does not believe this is a bug, but a side-effect of this method of calculation. โจ
Barassumes that there are8bits in both a byte and a char.
๐ญ BUGS ๐ญ
Baruses theopen()andfstat()functions to open and retrieve the size of regular files when using either the--in-fileor--out-filecommand line options. Some OS's do not support Large Files (file sizes up to(2**63)-1bytes) natively. Some OS's support Large Files but require_FILE_OFFSET_BITSor_LARGE_FILESto be defined properly at compile time. Other OS's support neither, but still allow programs to open files in excess of(2**32)-1through anO_LARGEFILEoption that can be passed to theopen()function.
When trying to open files greater than 2gb on an OS without Large File support, bar will exit with the message: "File too large". When trying to write more than 2gb of data to a file, bar will write 2**32-1 bytes and then the OS may terminate bar with a message similar to: "File size limit exceeded".
When trying to open files greater than 2gb on an OS without Large File support, but with the O_LARGEFILE option that can be passed to open(), bar will receive an error when trying to retrieve the file's size, but bar will be able to open the file anyway. Under these circumstances, bar will print a "File too large" error message, but will then proceed to transfer the data. Since bar will not be able to retrieve the file's size on it's own, the --size command line option must be used after the --in-file option to tell bar the file size manually. On such OS's, bar should be able to write more than 2gb of data to a file without any problems.
For OS's that support files greater than 2gb, either natively or through the Large File extension definitions mentioned above, bar should work as expected.
- The author has noticed that when running
barover an SSH connection, sometimes window resize events are not captured until after the display has gone through one or two more updates, which can cause the line to wrap. ๐ซ - The author has noticed that on some systems the use of aligned memory allocation, through either
memalign()orposix_memalign(), causesbarto commit a segmentation fault the first timeread()orreadv()is called and passed a pointer to the aligned memory as it's input buffer. Attempts were made to try to isolate systems in which this bug bites through tests inconfigure, but all tests devised passed with flying colors. Therefore aligned memory allocation is turned off by default, and may only be enabled by passing--enable-use-memaligntoconfigurewhen building the executable. - On some 64-bit systems it has been found that the CC compiler will, by default, compile
barin 32-bit mode. This has been known to cause math errors which result in segmentation faults and infinite loops. Although multipleconfiguretests have been added to the compilation phase to try to properly detect such compilers and compensate for such bugs, without access to such systems for debugging purposes there may be other bugs waiting to rear their ugly heads. ๐
Report all bugs to the author.
Bar was developed on a Sun workstation running Solaris 8. To the best of the author's knowledge bar should compile and run on other platforms without much trouble. Should other OS's require modifications to the code, the author welcomes all patch submissions, but requests that you include the file config.log and the output of gcc -dumpspecs (or a listing of predefined variables, if not using gcc). ๐
๐ DISTRIBUTION ๐
The latest version of bar can always be found at:
http://www.freshmeat.net/projects/commandlineprogressbar
http://sourceforge.net/projects/clpbar/
๐ AUTHOR ๐
Bar was written by Michael Peek. See DISTRIBUTION above for contact information.
Occasionally, the author fancies that he knows what he's doing. It is at these times more than ever that his coworkers should cower in fear... ๐ iconic behavior honestly.
and that's a wrap bestie!! ๐ this page was brought to you by the 4 November 2003 release of BAR(1) โ go forth and watch those bytes fly, no cap ๐ฆโจ
๐ฆ where this page comes from
- debian bookworm: bar 1.11.1-4
- debian trixie: bar 1.11.1-4
- nixos 26.05: bar 1.11.1
- nixpkgs unstable: bar 1.11.1
- ubuntu jammy: bar 1.11.1-3
- ubuntu noble: bar 1.11.1-4
- ubuntu resolute: bar 1.11.1-4build1
- ubuntu stonking: bar 1.11.1-4build1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms