lsd icon indicating copy to clipboard operation
lsd copied to clipboard

Unable to list the contents of a symbolic directory

Open maleyva1 opened this issue 4 years ago • 12 comments

  • os: Ubuntu 20.10
  • lsd --version: 0.20.1
  • echo $TERM: xterm-256color
  • echo $LS_COLORS:

I have a symbolic link to folder that I use to store music. There's over 3K files with over 400 directories that fails to display with lsd. On the other hand lsd displays the contents of another symbolic linked directory containing 3 items. ls and tree work fine in displaying the contents.

Expected behavior

Display the contents of a directory A where A is a symbolic link.

Actual behavior

lsd returns with "Invalid argument (os error 22)"

maleyva1 avatar Mar 10 '21 06:03 maleyva1

Are you able to display the contents when you directly try to list the folder instead of the symlink?

meain avatar Mar 10 '21 13:03 meain

No.

maleyva1 avatar Mar 10 '21 14:03 maleyva1

@maleyva1 can you paste some example output of the lsd and ls, so that we can try to find out what the problem might be?

zwpaper avatar Mar 12 '21 10:03 zwpaper

@zwpaper

asciicast

maleyva1 avatar Mar 13 '21 02:03 maleyva1

hi @maleyva1 thanks for sharing the screencast, I noticed the error output but still has no clue about the cause, can you help to make sure 2 more things:

  1. is there an alias for lsd? try to check it with type lsd and unalias it.
  2. maybe there are some filenames that make it error, try to check it with
for i in `ls`; do out=`lsd $i`; if [ $? != 0 ]; then echo "$i: $out"; fi; done

zwpaper avatar Mar 14 '21 13:03 zwpaper

@zwpaper

  1. No. I have ls aliased to lsd.
  2. Here's a screencast of the output: asciicast

maleyva1 avatar Mar 14 '21 19:03 maleyva1

sorry for my mistake, there are some bugs in my command, please try this again:

for i in . ; do out=`lsd $i 2>&1`; if echo $out | grep error >/dev/null 2>&1 ; then echo "$i: $out" ; fi; done

BTW, the bugs are:

  1. there are spaces inside your filenames and I did not consider it.
  2. lsd does not return an error code when errors occurred, I will create an issue for this

zwpaper avatar Mar 15 '21 03:03 zwpaper

@zwpaper No problem. I appreciate the help. Here's the screencast of the command: asciicast

maleyva1 avatar Mar 15 '21 03:03 maleyva1

@maleyva1 Sorry that we are making you run quite a few scripts. But if you don't mind sharing your music collection could you post the output file generated by this.

for i in *;do printf "%s : " "$i"; lsd -d -l "$i"; done > output

meain avatar Mar 15 '21 14:03 meain

@meain It's a bit long but here you go: output.txt

maleyva1 avatar Mar 16 '21 02:03 maleyva1

Is there any network disk mounting under this dir?

zwpaper avatar Mar 21 '21 07:03 zwpaper

@zwpaper No.

maleyva1 avatar Mar 22 '21 13:03 maleyva1