[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] [PATCH] Add implementation of pdf_fsys_disk_item_p
From: |
Aleksander Morgado |
Subject: |
Re: [pdf-devel] [PATCH] Add implementation of pdf_fsys_disk_item_p |
Date: |
Mon, 28 Jul 2008 13:05:17 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080505) |
> Hello Zac.
>
> Attached is the merge directive for pdf_fsys_disk_item_p.
>
> + file = fopen ((char*)ascii_path, "r");
> + if (file == NULL)
> + {
> + goto error_cleanup;
> + }
>
> Note that such a call to fopen will fail if the file is not readable,
> but still exists in the filesystem. Also, it will work for directories
> in POSIX systems but, will it work in windows systems?
>
> This function should also work for files for which the client doesnt
> have read perms.
Yep, I missed this mail. That's my point in my previous mail.
>
> 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.
-Aleksander