MCPcopy Create free account
hub / github.com/coreutils/coreutils / print_size

Function print_size

src/du.c:449–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447/* Print size (and optionally time) indicated by *PDUI, followed by STRING. */
448
449static void
450print_size (const struct duinfo *pdui, char const *string)
451{
452 print_only_size (opt_inodes
453 ? pdui->inodes
454 : pdui->size);
455
456 if (opt_time)
457 {
458 putchar ('\t');
459 bool ok = show_date (time_format, pdui->tmax, localtz);
460 if (!ok)
461 {
462 /* If failed to format date, print raw seconds instead. */
463 char buf[INT_BUFSIZE_BOUND (intmax_t)];
464 fputs (timetostr (pdui->tmax.tv_sec, buf), stdout);
465 }
466 }
467 putchar ('\t');
468 fputs (string, stdout);
469 putchar (opt_nul_terminate_output ? '\0' : '\n');
470 if (fflush (stdout) < 0)
471 write_error ();
472}
473
474/* Fill the di_mnt set with local mount point dev/ino pairs. */
475

Callers 2

process_fileFunction · 0.85
mainFunction · 0.85

Calls 4

print_only_sizeFunction · 0.85
show_dateFunction · 0.85
timetostrFunction · 0.85
write_errorFunction · 0.85

Tested by

no test coverage detected