Age | Commit message (Collapse) | Author |
|
Otherwise, for files or totals that are too big, numbers would
be truncated. Patch mostly by Michael Stone.
|
|
|
|
(enum) [APPARENT_SIZE_OPTION]: New member.
(long_options): Add it.
(usage): Describe it.
(main): Handle it.
['b']: Set apparent_size.
|
|
(print_only_size): Reflect the fact that we're printing byte counts,
not ST_NBLOCKSIZE-byte-block counts.
(print_size): Call print_only_size rather than duplicating its code.
(process_file): Accumulate byte counts, rather than block counts.
|
|
--separate-dirs (-S).
|
|
one `sum' array, and change how -S works back to the way it was
before 2003-01-31. Patch by Bruno Haible.
|
|
Report correct usage for directories, not 0.
(process_file): Return for `file_type == FTW_DPRE'
_before_ recording the dev/ino of a directory.
|
|
(du_files): Add prototype with ATTRIBUTE_NORETURN.
Exit from this function, not from...
(main): ...here.
Instead, if possible, invoke du_files through a macro that
runs it with a large, mmap'd stack.
|
|
or for files whose dev/inode we've already seen.
|
|
|
|
|
|
|
|
option argument, don't exit right away, in case there are others.
Rather record the failure and exit after processing other options.
|
|
Include "dirname.h", "ftw.h", and "quotearg.h".
(AUTHORS): Add self.
(opt_one_file_system): Move global into `main'.
(path, xstat, exit_status): Remove declarations.
(arg_length, suffix_length): New globals.
(G_fail): New global, sort of like the old `exit_status'.
(IS_FTW_DIR_TYPE): Define.
(print_only_size): New function.
(process_file): New function.
(str_init, ensure_space, str_copyc, str_concatc): Remove functions.
(str_trunc, pop_dir, count_entry): Likewise.
(du_files): Rewrite to use nftw.
|
|
|
|
It's already defined in sys2.h.
|
|
Define to rpl_lstat, so that even on systems like Solaris 5.8,
du honors (per POSIX) the trailing slash on an argument referring
to a symlink-to-directory.
|
|
|
|
Rewrite so that `/' is no longer represented internally as
the empty string.
(count_entry): When appending a file name component,
account for the fact that the current path may end in `/'.
François Pinard reported that `du symlink-to-dir/' was not
equivalent to `du symlink-to-dir/.'. Now it is.
|
|
(output_block_size): Now uintmax_t, not int, to handle larger
block sizes. All uses changed.
|
|
|
|
a command-line argument.
Reported by Michal Svec. Based on a patch by Andreas Schwab.
|
|
|
|
since it's already included from sys2.h via system.h.
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
|
|
|
|
|
|
(long_options, usage, main): Add -B.
(usage): Deprecate --kilobytes, -m, --megabytes.
Document size suffixes.
|
|
instead of hard-coding --help and --version descriptions.
|
|
for short options too.''
|
|
Use fputs, not printf.
|
|
|
|
slightly-modified copies of those that used to be in cp-hash.c.
(struct entry) [coll_link]: Remove member.
(struct htab): Remove.
(hash_reset, hash_init, hash_insert2, hash_insert): Remove functions.
Include hash.h and same.h.
(htab): Change type of global to `struct hash';
(entry_hash, entry_compare, hash_ins): New functions.
(count_entry): Use hash_ins instead of hash_insert.
|
|
|
|
|
|
|
|
merely because we couldn't `chdir' into it. That would give subtly
different results in some cases. Reported by Mattias Wadenstein
via Michael Stone.
|
|
|
|
and `..'. Reported by Stephen Smoogen, based on a patch from H.J. Lu.
|
|
corresponding argument in a `quote (...)' call.
|
|
invoking savedir, and assume that errno is nonzero if savedir fails.
|
|
|
|
|
|
for that purpose instead.
(count_entry): Also save the directory if we're saving more
than one level.
Fix file descriptor and memory leak when chdir fails.
|
|
(count_entry): Factor out common code (pop_dir), and call the new
function instead.
Move declaration of global, `stat_buf' into this function.
(du_files): Don't stat `.' or call save_cwd, since count_entry
never returns with a changed working directory.
|
|
(main): Likewise, for add_exclude_file.
|
|
Define these and use them instead of `CHAR_MAX + n'.
|
|
|