Closed muellerto closed 1 year ago
Hi @muellerto. Thanks for reporting, as always.
The thing is: in previous versions, both the p
and pp
commands always returned information about the dereferenced symlink, providing no way to get info about the link itself. So, I decided to follow some standard practices (mostly ls(1) and stat(1)): in case of symlinks to directories they give info about the symlink if the name passed doesn't end with a slash. Otherwise, they provide information about the target directory.
However, as you noticed yourself, this wasn't enough for clifm:
pp
command is mainly intended to work with directories, so that printing full directory information (mostly recursive size) just makes sense.So, after thinking about it for a while, I came out with this solution:
p
never dereferences symlinks.pp
always dereferences symlinks, and, in case of directories, it prints the full directory size.In this way, pp
works as before, with the added feature of dereferencing symlinks. If you rather need information about the link itself, just use p
. I think this new behavior is more consistent and predictable.
Great! Have it already.
Another solution could have been that the pp
output contains both the original line from p
related to the link itself and an additional line below related to the contents.
I've seen on Linux a link itself has indeed always a size of some few bytes, on Windows it's just 0.
Thanks a lot for this. I think it's transparent and explainable now.
Describe the bug If you have a symbolic link to a directory clifm's file list shows that there's content. If the user runs
pp
on that entry thepp
output says always 0 bytes, as if the directory would be empty.Expected behavior I would think it would be a good idea to handle a symbolic link to a directory exactly like the directory itself.
pp
should sum up the sizes of the files contained in the directory.p
could say 0 bytes.Desktop
Additional context I know
du
requires-D
for symbolic links and does then sum up but the caller must not use-D
for real directories, this leads to a totally different output. But here the type of the item is already known, you can calldu
in every case correctly.