Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
module:filelist [2021/04/11 22:10] – created digital manmodule:filelist [2021/04/18 18:37] (current) – [File List] link to FILELIST digital man
Line 1: Line 1:
 ====== File List ====== ====== File List ======
  
-New for Synchronet v3.19, this JavaScript utility script (''filelist.js'') replaces the functionality of the old FILELIST program.+New for Synchronet v3.19, this JavaScript utility script (''filelist.js'') replaces the functionality of the old [[util:FILELIST]] program.
  
 Normally executed via [[util:JSexec]], this script will generate a list of files from one or more Synchronet system's file databases (filebases) and send the list to ''stdout'' which can be redirected to a file using normal system shell methods, for example: Normally executed via [[util:JSexec]], this script will generate a list of files from one or more Synchronet system's file databases (filebases) and send the list to ''stdout'' which can be redirected to a file using normal system shell methods, for example:
Line 27: Line 27:
   -json[=spaces]  use JSON formatted output   -json[=spaces]  use JSON formatted output
   -new=<days>     include new files uploaded in past <days>   -new=<days>     include new files uploaded in past <days>
-  -p=[list      specify comma-separated list of property names to print+  -p=<list      specify comma-separated list of property names to print 
 +  -cdt            include credit value instead of file size
   -ext            include extended file descriptions   -ext            include extended file descriptions
   -ext=<prefix>   specify extended file description prefix   -ext=<prefix>   specify extended file description prefix
Line 33: Line 34:
   -date=<fmt>     specify date/time display format (strftime syntax)   -date=<fmt>     specify date/time display format (strftime syntax)
   -size=<fmt>     specify size/byte display format (0-12)   -size=<fmt>     specify size/byte display format (0-12)
-  -name=<len>     specify filename length+  -name=<len>     specify filename length (default: 12)
   -pad            pad filename with spaces   -pad            pad filename with spaces
 +  -adate          use latest archived file date/time instead of file time
   -v              increase verbosity (detail) of output   -v              increase verbosity (detail) of output
 </file> </file>
Line 75: Line 77:
  
 To reverse the output order of files, include the ''-reverse'' option. To reverse the output order of files, include the ''-reverse'' option.
 +
 +==== Format Output ====
 +
 +The 2 main classes of output are JSON or free-form text. To specify JSON formatted output, use the ''-json'' command-line option. Many of the other command-line options do not serve a purpose when using JSON formatted output.
 +
 +=== JSON ===
 +The default JSON output format is pretty-printed with 4-space indentation. To control the indentation level, use ''-json=<spaces>'' where "<spaces>" is the number of spaces to use for indenting or 0 for none.
 +
 +The default metadata included in the JSON formatted output is just the names of each file. To add more detail (file properties), specify one or more ''-v'' options on the command-line to increase the verbosity:
 +  * Default: an array of file names
 +  * With ''-v'': an array of file objects including: ''name, size, time, crc16, crc32, md5, sha1,'' and ''dir'' properties.
 +  * With ''-vv'': an array of file objects adding: ''from, desc, cost, added, last_downloaded,'' and ''times_downloaded'' and if defined: ''anon and tags''.
 +  * With ''-vvv'': an array of file objects adding: ''extdesc'' (extended description).
 +  * With ''-vvvv'': an array of file objects with all possible properties, even those that are blank/undefined.
 +
 +=== Free Form ===
 +
 +The default non-JSON (free form) text output is controlled with the ''-v'' (verbosity) option or the ''-ext'' (extended description) option.
 +
 +  * Default: file names only
 +  * With ''-v'': include file sizes (limited to 12 characters in length, not padded)
 +  * With ''-vv'': add the file summaries (short descriptions)
 +  * With ''-vvv'': add the extended file descriptions (same as the ''-ext'' option)
 +
 +To increase the maximum length of the file name displayed, use the ''-name=<length>'' option.
 +
 +By default, filenames shorter than the maximum are not padded (between the base file name and suffix/extension).
 +To pad (with spaces) short names and file extensions, use the ''-pad'' option.
 +
 +By default, extended descriptions are indented with a prefix that matches the ''FILES.BBS'' standard (indented with spaces separated from the description with a pipe character). To customize the extended description line prefixes, use the ''-ext=<prefix>'' option.
 +
 +To choose your own file object properties to include in the list, specify the comma-separated list of property names with the ''-p=<list>'' option.
 +
 +To choose your own ''printf''-style format string, use the ''-fmt=<fmt>'' command-line option.
 +
 +The default date/time format will be either "MM/DD/YY" or "DD/MM/YY" depending on the [[util:SCFG]]->System->Toggle options->European Date Format setting. To choose your own date/time display format, specify a [[custom:strftime]] format string with the ''-date=<fmt>'' option.
 +
 +The default file credit/size format is a rounded floating point format with a single digit of precision and a suffix of G, M, K or B. To choose an alternate file credit/size format, specify the format number (0-12) with the ''-size=<fmt>'' option:
 +
 +== Size Formats ==
 +The formatting options for file sizes (bytes) or credit values:
 +^        0((FILES.BBS compatible))  ^    1  ^     2((the default))  ^      3  ^    4  ^      ^      6  ^  7  ^    ^    9  ^    10  ^     11  ^    12  ^
 +|      9805 |   10K |   9.6K |   9.58K |   10K |   9.6K |   9.58K |  0M | 0.0M | 0.01M | 0.009M |  9,805B |    10K |
 +|      3177 |    3K |   3.1K |   3.10K |    3K |   3.1K |   3.10K |  0M | 0.0M | 0.00M | 0.003M |  3,177B |     3K |
 +|      5120 |    5K |   5.0K |   5.00K |    5K |   5.0K |   5.00K |  0M | 0.0M | 0.00M | 0.005M |  5,120B |     5K |
 +|     15872 |   16K |  15.5K |  15.50K |   16K |  15.5K |  15.50K |  0M | 0.0M | 0.02M | 0.015M |     16K |    16K |
 +|     61114 |   60K |  59.7K |  59.68K |   60K |  59.7K |  59.68K |  0M | 0.1M | 0.06M | 0.058M |     60K |    60K |
 +|    349925 |  342K | 341.7K | 341.72K |  342K | 341.7K | 341.72K |  0M | 0.3M | 0.33M | 0.334M |    342K |   342K |
 +|       350 |  350B |   350B |    350B |    0K |   0.3K |   0.34K |  0M | 0.0M | 0.00M | 0.000M |    350B |     1K |
 +|      2134 |    2K |   2.1K |   2.08K |    2K |   2.1K |   2.08K |  0M | 0.0M | 0.00M | 0.002M |  2,134B |     2K |
 +|      8846 |    9K |   8.6K |   8.64K |    9K |   8.6K |   8.64K |  0M | 0.0M | 0.01M | 0.008M |  8,846B |     9K |
 +|   3599786 |    3M |   3.4M |   3.43M |    3M |   3.4M |   3.43M |  3M | 3.4M | 3.43M | 3.433M |  3,515K | 3,515K |
 +|    266531 |  260K | 260.3K | 260.28K |  260K | 260.3K | 260.28K |  0M | 0.3M | 0.25M | 0.254M |    260K |   260K |
 +|   1423559 |    1M |   1.4M |   1.36M |    1M |   1.4M |   1.36M |  1M | 1.4M | 1.36M | 1.358M |  1,390K | 1,390K |
  
 ===== See Also ===== ===== See Also =====