[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "ls -d" OK, but not "ls"



On 2021-06-23 16:26:10 +0200, Vincent Lefevre wrote:
> On 2021-06-23 10:11:57 -0400, The Wanderer wrote:
> > It could be useful to check on this with other tools. For a start, what
> > does
> > 
> > $ stat /etc/systemd/
> > 
> > report?
> 
>   File: /etc/systemd/
>   Size: 0               Blocks: 8          IO Block: 4096   directory
> Device: 17h/23d Inode: 118         Links: 3
> Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
> Access: 2021-04-19 09:40:10.717284464 +0200
> Modify: 2021-04-19 09:40:41.893170056 +0200
> Change: 2021-04-19 09:40:41.941169879 +0200
>  Birth: -

And while I'm at it, "strace" gives:

[...]
stat("/etc/systemd", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
openat(AT_FDCWD, "/etc/systemd", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
[...]

So, on the same directory, "stat" succeeds, but not "openat".

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: