Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit df49b436 authored by Rob Swindell's avatar Rob Swindell 💬

Beautify the file list files (e.g. NEWFILES.TXT) a bit

Use the file size estimates rather than actual byte values (to keep lines < 80 chars).
Use file name file summary/description is blank or doesn't exist.
parent 9a8c8e6d
...@@ -1073,8 +1073,15 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode) ...@@ -1073,8 +1073,15 @@ int sbbs_t::listfileinfo(uint dirnum, const char *filespec, long mode)
void sbbs_t::listfiletofile(file_t* f, FILE* fp) void sbbs_t::listfiletofile(file_t* f, FILE* fp)
{ {
char fname[13]; /* This is one of the only 8.3 filename formats left! (used for display purposes only) */ char fname[13]; /* This is one of the only 8.3 filename formats left! (used for display purposes only) */
fprintf(fp, "%-*s %10lu %s\r\n", (int)sizeof(fname)-1, format_filename(f->name, fname, sizeof(fname)-1, /* pad: */TRUE) char bytes[32];
,(ulong)getfilesize(&cfg, f), f->desc); unsigned units = 1;
off_t size = getfilesize(&cfg, f);
do {
byte_estimate_to_str(size, bytes, sizeof(bytes), units, /* precision: */1);
units *= 1024;
} while(strlen(bytes) > 6 && units < 1024 * 1024 * 1024);
fprintf(fp, "%-*s %7s %s\r\n", (int)sizeof(fname)-1, format_filename(f->name, fname, sizeof(fname)-1, /* pad: */TRUE)
,bytes, (f->desc == NULL || *f->desc == '\0') ? f->name : f->desc);
} }
int extdesclines(char *str) int extdesclines(char *str)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment