> I would suggest to use 'stat' or 'lstat' to do this (those functions > has support for directories, special files, etc). AFAIK mingw has > support for the stat function and anyway we have the sys_stat.h > portability file from gnulib already installed in libgnupdf.
stat gives you the permission bits, but we should also consider the way the filesystem was mounted (read-only filesystems can happen). access() is the good way to do it, but don't know if it's portable or not. access() is supported in mingw32 with some restrictions.