Pádraig Brady <[email protected]> writes:

> since the meaning of st_size is not defined for directories
> we use the fallback of lseek(..., SEEK_END).
>
> On your (file) system it's returning OFF_T_MAX.
> What file system are you using?
>
> On tmpfs lseek() returns EINVAL,
> on BTRFS it returns the same as st_size from stat.
>
> Perhaps we could prefer st_size for directories,
> but it is an edge case as there is no real meaning
> to the st_size of a directory.

I confirm I see the same behavior as Daniel with ext4.

Wouldn't it be better to try to get the kernel to have some consistency
here?

Collin



Reply via email to