Skip to content

Commit

Permalink
cli: 'info' command also reports on unwriteable files and directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbriggs committed Dec 11, 2024
1 parent 79c5e75 commit 40a7d6a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ngsarchiver/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def main(argv=None):
"Compressed",
"Compressed%",
"Unreadable?",
"Unwriteable?",
"Symlinks?",
"Dirlinks?",
"External?",
Expand Down Expand Up @@ -246,6 +247,7 @@ def main(argv=None):
f"{float(compressed_file_size)/float(size)*100.0:.1f}" \
if not (compressed_file_size == 0 and size == 0) else "0.0",
format_bool(not d.is_readable),
format_bool(not d.is_writeable),
format_bool(d.has_symlinks),
format_bool(d.has_dirlinks),
format_bool(d.has_external_symlinks),
Expand Down Expand Up @@ -282,6 +284,13 @@ def main(argv=None):
is_readable = False
if is_readable:
print("-- no unreadable files")
print("Unwriteable files:")
is_writeable = True
for f in d.unwriteable_files:
print(f"-- {f}")
is_writeable = False
if is_writeable:
print("-- no unwriteable files")
print("Symlinks: %s" % format_bool(d.has_symlinks))
print("Dirlinks:")
has_dirlinks = False
Expand Down Expand Up @@ -335,6 +344,8 @@ def main(argv=None):
else:
print(f"Unreadable files : "
f"{format_bool(not d.is_readable)}")
print(f"Unwriteable files : "
f"{format_bool(not d.is_writeable)}")
print(f"Symlinks : {format_bool(d.has_symlinks)}")
print(f"Dirlinks : {format_bool(d.has_dirlinks)}")
print(f"External symlinks : "
Expand Down

0 comments on commit 40a7d6a

Please sign in to comment.