version 1.31, 2015/10/10 05:32:52 |
version 1.32, 2016/08/24 03:13:45 |
|
|
|
|
|
|
int linkchk(FTSENT *); |
int linkchk(FTSENT *); |
void prtout(quad_t, char *, int); |
void prtout(int64_t, char *, int); |
void usage(void); |
void usage(void); |
|
|
int |
int |
|
|
FTS *fts; |
FTS *fts; |
FTSENT *p; |
FTSENT *p; |
long blocksize; |
long blocksize; |
quad_t totalblocks; |
int64_t totalblocks; |
int ftsoptions, listfiles, maxdepth; |
int ftsoptions, listfiles, maxdepth; |
int Hflag, Lflag, cflag, hflag, kflag; |
int Hflag, Lflag, cflag, hflag, kflag; |
int ch, notused, rval; |
int ch, notused, rval; |
|
|
* root of a traversal, display the total. |
* root of a traversal, display the total. |
*/ |
*/ |
if (p->fts_level <= maxdepth) |
if (p->fts_level <= maxdepth) |
prtout((quad_t)howmany(p->fts_number, |
prtout(howmany(p->fts_number, |
(unsigned long)blocksize), p->fts_path, |
(unsigned long)blocksize), p->fts_path, |
hflag); |
hflag); |
break; |
break; |
|
|
if (errno) |
if (errno) |
err(1, "fts_read"); |
err(1, "fts_read"); |
if (cflag) { |
if (cflag) { |
prtout((quad_t)howmany(totalblocks, blocksize), "total", hflag); |
prtout(howmany(totalblocks, blocksize), "total", hflag); |
} |
} |
fts_close(fts); |
fts_close(fts); |
exit(rval); |
exit(rval); |
|
|
} |
} |
|
|
void |
void |
prtout(quad_t size, char *path, int hflag) |
prtout(int64_t size, char *path, int hflag) |
{ |
{ |
if (!hflag) |
if (!hflag) |
(void)printf("%lld\t%s\n", (long long)size, path); |
(void)printf("%lld\t%s\n", size, path); |
else { |
else { |
char buf[FMT_SCALED_STRSIZE]; |
char buf[FMT_SCALED_STRSIZE]; |
|
|
if (fmt_scaled(size * 512, buf) == 0) |
if (fmt_scaled(size * 512, buf) == 0) |
(void)printf("%s\t%s\n", buf, path); |
(void)printf("%s\t%s\n", buf, path); |
else |
else |
(void)printf("%lld\t%s\n", (long long)size, path); |
(void)printf("%lld\t%s\n", size, path); |
} |
} |
} |
} |
|
|