wodny / ncdu-export

Standalone ncdu export feature
GNU General Public License v3.0
34 stars 9 forks source link

redirect printout to a file, added status #1

Closed caco3 closed 7 years ago

caco3 commented 7 years ago

redirect printout directly to a file (ncdu_export.json) show current file getting scanned

jose1711 commented 7 years ago

why not make this an option? i see some benefits being able to write to stdout.

wodny commented 7 years ago

why not make this an option? i see some benefits being able to write to stdout.

@jose1711 I won't commit the proposed patch. It needs refactoring and writing to a file will be an option for sure. Firstly, because a simple redirect should be enough. Secondly, if someone really needs an output filename as a parameter, it must be an option. Sending progress information to a TTY will also be an option. I need some time to make those changes because currently I'm busy at work.

caco3 commented 7 years ago

@ jose1711 AFAIK, if you send it to the stdout, you can't show any progress. Scanning my NAS took over 4 hours, so I prefer to see some progress. IMO it would be the best if one could provide an output-file name (-o parameter) like ncdu does. If needed, stdout also could be an option. I didn't implement it simply because I had no need!

Another feature which would be great is if the script also could visualize them like ncdu does. This then would be almost a python implementation of ncdu.

jose1711 commented 7 years ago

how about using pv for progress visualization?

wodny commented 7 years ago

@caco3 Showing progress is possible even when redirecting. If on a TTY the stdin still holds fd to the TTY. See the recent patch.