Date: Sat, 12 Feb 2022 15:10:54 +1100 From: raf <freebsd@raf.org> To: freebsd-questions@freebsd.org Subject: Definition of struct stat st_size for directories Message-ID: <YgczTldqDaKNUwEp@raf.org>
next in thread | raw e-mail | index | archive | help
Hi, The FreeBSD stat(2) manpage only defines st_size for regular files and symlinks. But I've noticed that for directories, it seems to always be the number of entries within the directory (including . and ..). I'm seeing this with 13.0-RELEASE and zfs. Is this always the case on FreeBSD? Or just for zfs? Or am I imagining things? If I can rely on this behaviour, I can make a small part of a program I'm writing faster when it's on FreeBSD. cheers, raf
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YgczTldqDaKNUwEp>