Why am I able to cat a directory?

Stanislav Syekirin stanislav.syekirin at studium.fernuni-hagen.de
Mon Jan 23 01:38:08 PST 2023


Thank you for explaining how it works. It didn't occur to me that it 
might me filesystem-dependent and not OS-dependent.

Regards
Stanislav

On So, 22 Jan 2023 22:43:08 -0800
  Matthew Dillon <dillon at backplane.com> wrote:
> Being able to cat a directory (i.e. issue read()s) depends on the
> filesystem.   In the old days, directories were scanned via read()s 
>instead
> of with purpose-specific system calls.  Newer filesystems do not 
>implement
> read() support on directories.   So, for example, on DragonFly, you 
>can cat
> a UFS directory but you cannot cat a HAMMER2 directory.
> 
> -Matt




More information about the Users mailing list