Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls: too many totals #359

Merged
merged 1 commit into from
Dec 2, 2023
Merged

ls: too many totals #359

merged 1 commit into from
Dec 2, 2023

Commits on Dec 2, 2023

  1. ls: too many totals

    * File arguments are split into two lists: Dirs and Files
    * Two separate loops call List(), first for Files list then for Dirs
    * "perl ls -lR a a/a" was printing a "total" line twice, once (correctly) for dir "a" then (incorrectly) for regular file "a/a"
    * Directory name line "a/a:" was also being printed for argument "a/a" but it is not a directory (see below output)
    * Fix this by passing a new param to List() to tell it whether the entry being listed is a directory
    
    %perl ls -lR a a/a # old output
    a/a:
    total 176
    -rwxr-xr-x   1 pi       pi           88214 Nov 21 10:20 a/a
    
    a:
    total 224
    -rwxr-xr-x   1 pi       pi           88214 Nov 21 10:20 a
    drwxr-xr-x   2 pi       pi            4096 Dec  1 19:32 b
    -rw-r--r--   1 pi       pi           20480 Nov 20 04:02 new.tar
    
    a/b:
    total 8
    -rw-r--r--   1 pi       pi               3 Dec  1 19:32 new
    mknos authored Dec 2, 2023
    Configuration menu
    Copy the full SHA
    dd4c91b View commit details
    Browse the repository at this point in the history