pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] FS module, file readable/writeable


From: Zac Brown
Subject: Re: [pdf-devel] FS module, file readable/writeable
Date: Sun, 27 Jul 2008 10:58:29 -0700
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

address@hidden wrote:
   > while working on the FS module unit test design I had some thoughts
   > about pdf_fsys_item_readable_p() and pdf_fsys_item_writeable_p().
   > Atm they return PDF_TRUE or PDF_FALSE depending on wether the given file
   > is readable/writeable or not. But shouldn't both functions handle
   > non-existing files, Or will they just return PDF_FALSE?
> I agree with you. Returning a pdf_status_t with an error code could be
   better. Like PDF_OK if successful, PDF_ERROR if not, and PDF_EEXIST if
   file doesn't exist.

Agreed.
I also agree.


   And BTW, we should probably have an additional function for multiple
   checks, like a wrapper for the access() function.

   Then the pdf_fsys_item_p, pdf_fsys_item_is_readable_p and
   pdf_fsys_item_is_writable_p functions could even be macros calling
   pdf_fsys_item_access.

That modification would involve to change the filesystem
implementation interface. Not all filesystems will have an access-like
functionality in a native way.

As a matter of convenience we could provide a pdf_fsys_item_access function
that would internally use the pdf_fsys_item_* functions.

We basically have this already with pdf_fsys_get_item_props. My intention is to just have pdf_fsys_item_{writable/readable}_p call that function in the disk implementation.

For pdf_fsys_get_item_p I went the route of just trying to open the file. Though I could just make it call pdf_fsys_get_item_props as well.

-Zac





reply via email to

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