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: jemarch
Subject: Re: [pdf-devel] FS module, file readable/writeable
Date: Sun, 27 Jul 2008 16:07:03 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

   > 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. 

   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.





reply via email to

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