ASCCON / DStat

Quickly gather and print directory statistics.
MIT License
1 stars 0 forks source link

Specifying `.` on CLI stops further directory processing #21

Closed ASCCON closed 6 months ago

ASCCON commented 6 months ago
[ wgd@LIGETI Lo 65E934FC Git github.com:ASCCON DStat://DStat "6-add-l-flag" ]
$ ./dstat /tmp /usr . /var /etc
Directories:
    /Users/wgd/code/ASCCON/DStat
    /usr
    /tmp
Totals:
      16:directories
       1:FIFO file
       0:character special files
       0:block special files
      16:regular files
       2:symlinks
       1:socket
       0:union whiteout files
       0:unknown file types
[ wgd@LIGETI Lo 65E93505 Git github.com:ASCCON DStat://DStat "6-add-l-flag" ]
$ ./dstat /tmp /usr ${PWD} /var /etc
Directories:
    /etc
    /var
    /Users/wgd/code/ASCCON/DStat
    /usr
    /tmp
Totals:
      72:directories
       1:FIFO file
       0:character special files
       0:block special files
      69:regular files
       5:symlinks
       1:socket
       0:union whiteout files
       0:unknown file types
[ wgd@LIGETI Lo 65E93528 Git github.com:ASCCON DStat://DStat "6-add-l-flag" ]
$ ./dstat /tmp /usr . /var /etc -l  
Directories:
    /Users/wgd/code/ASCCON/DStat
    /usr
    /tmp
+--------+--------+--------+--------+--------+--------+--------+--------+
| Regulr |    Dir |   Link |  Block |   Char |   FIFO | Socket | WhtOut |
+--------+--------+--------+--------+--------+--------+--------+--------+
|     16 |     16 |      2 |      0 |      0 |      1 |      1 |      0 |
+--------+--------+--------+--------+--------+--------+--------+--------+
[ wgd@LIGETI Lo 65E936A8 Git github.com:ASCCON DStat://DStat "6-add-l-flag" ]
$ ./dstat /tmp /usr ${PWD} /var /etc -l
Directories:
    /etc
    /var
    /Users/wgd/code/ASCCON/DStat
    /usr
    /tmp
+--------+--------+--------+--------+--------+--------+--------+--------+
| Regulr |    Dir |   Link |  Block |   Char |   FIFO | Socket | WhtOut |
+--------+--------+--------+--------+--------+--------+--------+--------+
|     69 |     72 |      5 |      0 |      0 |      1 |      1 |      0 |
+--------+--------+--------+--------+--------+--------+--------+--------+

…and the DEBUG messages are even whackier!

ASCCON commented 6 months ago
[ wgd@LIGETI Lo 65E9394B Git github.com:ASCCON DStat://DStat "6-add-l-flag" ]
$ ./dstat . /usr
<DEBUG> dstat.c:114:createDirList(): initialised dir_path
<DEBUG> dstat.c:407:main(): loop: 00: param_index = 1, dir_cnt = 0
<DEBUG> dstat.c:162:testDir(): FQP: /Users/wgd/code/ASCCON/DStat
<DEBUG> dstat.c:165:testDir(): TRUE
<DEBUG> dstat.c:183:addDir(): testDir returned TRUE to addDir
<DEBUG> dstat.c:132:createDirNode(): /Users/wgd/code/ASCCON/DStat
<DEBUG> dstat.c:185:addDir(): addDir /Users/wgd/code/ASCCON/DStat
<DEBUG> dstat.c:191:addDir(): num_dirs: 1
<DEBUG> dstat.c:407:main(): loop: 01: param_index = 2, dir_cnt = 1
<DEBUG> dstat.c:173:testDir(): FALSE
<DEBUG> dstat.c:193:addDir(): errno: 2
sers/wgd/code/ASCCON/DStat: No such file or directory
<DEBUG> dstat.c:414:main(): dir_cnt: 2
<DEBUG> dstat.c:203:getDirStats(): /Users/wgd/code/ASCCON/DStat
<DEBUG> dstat.c:211:getDirStats(): ep = 4
<DEBUG> dstat.c:218:getDirStats(): DT_DIR: 1
…
<DEBUG> dstat.c:222:getDirStats(): DT_REG: 16
Directories:
    /Users/wgd/code/ASCCON/DStat
Totals:
       5:directories
       1:FIFO file
       0:character special files
       0:block special files
      16:regular files
       0:symlinks
       0:sockets
       0:union whiteout files
       0:unknown file types

See what I mean?