[sword-devel] Confusing semantics for FileMgr::existsFile() and FileMgr::existsDir()

Troy A. Griffitts scribe at crosswire.org
Fri Oct 21 20:50:28 MST 2016


Thanks for pointing this out Jaak.  I've updated the comments to reflect 
that not only are file and dir checked for existence, but are also 
checked for readability.

On 10/21/2016 12:56 PM, Jaak Ristioja wrote:
> Hi!
>
> In reality, the FileMgr::existsFile() and FileMgr::existsDir() static
> methods not only check whether a file exists (or is visible to the
> calling process), but also whether the given file is readable, because
> internally, it uses the ::access system call with mode set to 04 which
> is R_OK. Whereas it would suffice to use F_OK to check for existance.
>
> What should the correct semantics and function names be?
>
> Blessings,
> J
>
> PS: Semantically, these two functions seem to duplicate one another,
> except for memory requirements.
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list