File attributes ????

I'm trying to sort out the charing of a problem folder, in the 'ls -l' list is shows as:

 d???????????? ? ?    ?          ?          ? Pi-Share

PiShare is the name of the directory, all the ??s make no sense to me at all, and no user (there are only two, pi and root) can make any changes to it.

It's the only directory out of many that has the problem.

I've tried chmod to change the atts, sudo su can't change anything or remove it, so I'm a bit confused.

Does anyone know how I can get rid of it so I can create it again?

Many thanks.

ls -ld Pi-share | od -c 

Please post the output of the above command. What UNIX are you using?

It looks like the file system itself is corrupted. We may have to resort to a tool like fsck.

Just ls -ld Pi-share will show a missing x-bit.
ls may read the directory contents with the file names, but may not access the inodes of the files with the attributes and a link to the data.
It is a bug (or feature?) in GNU ls to then show ???? for the attributes.
In contrast, Unix ls and old GNU ls say "filename: permission denied" on stderr and nothing on stdout.

I think the file system is hosed - and the directory permissions are history. GNU ls displays ? for unprintable characters in the locale. I believe.

I give an example, so everybody can reproduce.

mkdir newdir
touch newdir/file1
touch newdir/file2
chmod -x newdir

Unix (and very old GNU ls/glibc)

ls -l newdir
newdir/file2: Permission denied
newdir/file1: Permission denied
total 0

Old GNU ls

ls -l newdir
total 0
?--------- ? ? ? ?            ? file1
?--------- ? ? ? ?            ? file2

GNU ls

ls -l newdir
ls: cannot access newdir/file2: Permission denied
ls: cannot access newdir/file1: Permission denied
total 0
-????????? ? ? ? ?            ? file1
-????????? ? ? ? ?            ? file2
2 Likes