pdf-devel
[Top][All Lists]
Advanced

[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: Zac Brown
Subject: Re: [pdf-devel] [PATCH] Add implementation of pdf_fsys_disk_item_p
Date: Sun, 27 Jul 2008 14:39:29 -0700
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

address@hidden wrote:
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?

It will work on Windows systems.

This function should also work for files for which the client doesnt
have read perms.

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.

Now there are also the msdos-like "device" filenames such as PRN or
LPT8. For those files the item_p function should always return
PDF_TRUE. You can use the already implemented
'pdf_fsys_disk_win32_device_p' function to seek if a given filename is
a msdos special file.


I just realized that as well. I'm writing the pdf_fsys_disk_get_item_props function now and will use it to implement *writable_p, *readable_p, and *item_p.

-Zac




reply via email to

[Prev in Thread] Current Thread [Next in Thread]