Next: statvfs, Previous: sscanf, Up: Function Substitutes [Contents][Index]
stat
POSIX specification:
http://www.opengroup.org/onlinepubs/9699919799/functions/stat.html
Gnulib module: stat
Portability problems fixed by Gnulib:
off_t
is a 32-bit type, stat
may not correctly
report the size of files or block devices larger than 2 GB.
(Cf. AC_SYS_LARGEFILE
.)
stat("link-to-file/",buf)
succeeds instead
of failing with ENOTDIR
.
FreeBSD 7.2, AIX 7.1, Solaris 9, mingw64.
stat(".",buf)
and stat("./",buf)
give
different results:
mingw, MSVC 9.
Portability problems not fixed by Gnulib:
struct stat
.
stat
function sometimes sets errno
to EACCES
when
ENOENT
would be more appropriate.
struct stat
, it is not possible to
portably replace stat
via an object-like macro. Therefore,
expressions such as (islnk ? lstat : stat) (name, buf)
are not
portable, and should instead be written islnk ? lstat (name,
buf) : stat (name, buf)
.