[m-users.] file_exists? directory_exists?

Richard O'Keefe raoknz at gmail.com
Sun Jun 30 00:42:01 AEST 2019


Using see + seen does not test whether a file *exists* but whether
a file exists *and you are allowed to read it*.

It has always been the case in Unix that the only way to determine
if a file exists and you are allowed to read it is to try to open it
for input, thanks to the existence of concurrent processes.

With NFS, you can successfully open a file for input and
then be told "you can't do that" when you try to read it.

And then there's the possibility that a file might exist
and you might be allowed to read it, but the name you
have for it goes through a directory you aren't allowed
to search.

It you think too deeply about all the things that can go
wrong with testing whether a file "exists" you will go
mad. MAD, I say!  We're all DOOMED!


On Sat, 29 Jun 2019 at 19:03, emacstheviking <objitsu at gmail.com> wrote:

> Hi,
>
> All I have found is see/seen to see if a file exists. Have I missed
> something totally obvious ?
> And how about checking the existence of a directory too?
>
> It feels bad to have to use "see" and then "seen" (to undo see) just to
> test a file exists.
>
> I am sure I have not found the docs but TBH they doc are just the code for
> the module and when you are learning this stuff it makes it pretty hard to
> find anything at times.
>
> Thanks,
> Sean.
>
> _______________________________________________
> users mailing list
> users at lists.mercurylang.org
> https://lists.mercurylang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20190630/90e35039/attachment-0001.html>


More information about the users mailing list