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