Commit Graph

37 Commits

Author SHA1 Message Date
pjd
ec6e976acb Use 64bit 'fts_bignum' field instead of 32bit (on 32bit archs) field
'fts_number' to remember number of blocks.
This makes du(1) 64bit-clean.

This work is part of the BigDisk project:

	http://www.FreeBSD.org/projects/bigdisk/

Discussed on:	arch@
MFC after:	5 days
2005-01-07 00:12:24 +00:00
stefanf
fe0b14d703 Use the length modifier 'll' instead of 'q' to print long longs. 2004-07-28 16:03:13 +00:00
tjr
c325808d99 Respect locale settings from the environment. 2004-07-15 08:54:41 +00:00
phk
3bbd46d6d9 Give du(1) a -m option to report in megabytes.
Submitted by:	Vasily Korytov <deskpot@msk.yell.ru>
PR:	66976
2004-06-02 07:09:34 +00:00
pjd
00ba733985 Use humanize_number(3) to format sizes into a human readable form. 2004-05-24 22:22:29 +00:00
kientzle
bce9e1e3e0 More style fixes, per bde. 2004-05-02 17:54:57 +00:00
kientzle
2032f2c1be Style fixes, most suggested by bde. 2004-05-01 21:47:31 +00:00
kientzle
e168a7227a Speed up hardlink detection by using a self-sizing hash
table rather than the old linear list search.

On my "hardlink detection torture test", this reduced
user time from 4700 seconds down to 4.2 seconds
and wallclock time from 1:24:48 down to 1:08.
(Yes, that's over one THOUSAND times reduction in user time. ;-)
In the worst case, the new code doubles peak memory usage,
though it could actually reduce memory usage in many cases.

MFC after: 1 week
PR: misc/42167, bin/51151
2004-04-30 18:17:51 +00:00
obrien
488ffa9207 -{h,k} are mutually exclisive. So only pay attention to the last of the
two when both are given.
2003-03-30 21:25:16 +00:00
mike
4cb698efb2 Back out rev 1.27; getbsize(3)'s original interface has been restored.
Approved by:	markm
2002-12-30 18:13:07 +00:00
markm
a34db31767 Change the type of an unused variable to appease a warning. 2002-10-23 19:10:15 +00:00
dwmalone
13b25f0d4e ANSIify function definitions to avoid a warning. 2002-07-28 15:50:38 +00:00
obrien
3cb8dae44d Consistently use FBSDID 2002-06-30 05:25:07 +00:00
imp
0338ac6a1a remove __P 2002-03-22 01:22:50 +00:00
peter
9c4d7138d5 GRR. This was not WARNS=2 clean. You cannot printf a 'long' with
'%qd'.

usr.bin/du/du.c:288: warning: long long int format, long int arg (arg 2)

Pointy hat to:	markm
2002-02-08 07:49:13 +00:00
markm
e3b1036ef0 WARNS=2 fixup 2001-12-02 13:48:40 +00:00
robert
d259e7be88 Use the correct blocksize when invoked with both -h and -k
options.

PR:		30275
Reviewed by:	jake
2001-09-04 09:43:31 +00:00
roam
5ec2640c20 Add '-I mask' cmdline flag to ignore/skip files and subdirectories
matching a specified shell-glob mask.

Reviewed by:	no serious objections on -arch and -audit over
		the last few months
MFC after:	1 month
2001-06-13 06:38:58 +00:00
charnier
bbacd6e9e3 Use warnx(), -Wall cleaning and remove unused #include
Better use of .Nm and .Ar
2000-03-26 14:21:57 +00:00
mharo
862afadc67 fix bug with du -hd
Submitted by: dcs
2000-03-24 06:25:32 +00:00
mharo
8b7d29db39 Add human-readable output flag, -h
Reviewed by: obrien
2000-01-25 17:46:59 +00:00
archie
b24c3efc8e Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]). 1998-12-06 22:58:23 +00:00
rnordier
a86fff5841 Add missing '\n'; remove redundant 'h' case in getopt switch. 1998-11-05 07:24:21 +00:00
rnordier
67e469b82e Add -c option to usage string.
PR:           8568
Submitted by: Ryan Younce <ryany@pobox.com>
1998-11-05 07:18:41 +00:00
des
a73399dd90 Print correct total for -c option (previously, the total for the last
directory scanned was printed instead of the real total)

PR:		bin/7896
Submitted by:	Zach Heilig <zach@gaffaneys.com>
1998-09-11 15:53:08 +00:00
des
bb930bac45 Don't try to dereference a pointer to freed memory.
PR:		bin/7393
1998-07-29 17:50:06 +00:00
jkh
44b507a037 * add a -c option which displays the grand total of all files
counted.

 * re-word parts of the man page which I felt were badly worded
   or ambiguous.

 * change the behaviour of argument processing so that when more
   than one of the -P, -H and -L options are specified it will
   print an error message, rather than choosing the last option
   specified, this behaviour is more logical and consistent with
   other utilities.

 * change the behaviour of argument processing so that negative
   arguments to the -d option are not allowed.

PR:		5388
Submitted by:	Niall Smart <rotel@indigo.ie>
1997-12-29 20:56:21 +00:00
wosch
3a492240ff du(1) always exit with value zero.
$ du /foobar
du: /foobar: No such file or directory
$ echo $?
0
1997-08-29 11:40:00 +00:00
charnier
5491fe1a12 Document -k flag. 1997-06-30 06:50:07 +00:00
imp
cd84ece5fd compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
peter
cf1e7e3f26 Merge from Lite2 1997-03-11 13:43:33 +00:00
scrappy
32d546347f Add a 'depth (-d#)' flag to du
patched (context diff), compiled (w/ -Wall) and tested

Submitted by:	John-Mark Gurney <jmg@nike.efn.org>
1996-10-23 06:53:57 +00:00
rgrimes
79e59e9123 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
dg
d4c6d24d74 The last commit was bogus...the putenv doesn't affect the parent process,
so the BLOCKSIZE doesn't need to be preserved.
1994-08-12 10:19:05 +00:00
dg
41ee6a1b1f Implemented the -k flag more properly...don't destroy the user's setting
of the BLOCKSIZE environment variable.
1994-08-12 07:26:52 +00:00
wollman
9c322d6316 Gimme my `-k' option back! 1994-08-10 19:25:34 +00:00
rgrimes
f9ab90d9d6 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00