<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Using see + seen does not test whether a file *exists* but whether</div><div class="gmail_default" style="font-family:monospace,monospace">a file exists *and you are allowed to read it*.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">It has always been the case in Unix that the only way to determine</div><div class="gmail_default" style="font-family:monospace,monospace">if a file exists and you are allowed to read it is to try to open it</div><div class="gmail_default" style="font-family:monospace,monospace">for input, thanks to the existence of concurrent processes.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">With NFS, you can successfully open a file for input and</div><div class="gmail_default" style="font-family:monospace,monospace">then be told "you can't do that" when you try to read it.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">And then there's the possibility that a file might exist</div><div class="gmail_default" style="font-family:monospace,monospace">and you might be allowed to read it, but the name you</div><div class="gmail_default" style="font-family:monospace,monospace">have for it goes through a directory you aren't allowed</div><div class="gmail_default" style="font-family:monospace,monospace">to search.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">It you think too deeply about all the things that can go</div><div class="gmail_default" style="font-family:monospace,monospace">wrong with testing whether a file "exists" you will go</div><div class="gmail_default" style="font-family:monospace,monospace">mad. MAD, I say!  We're all DOOMED!</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 29 Jun 2019 at 19:03, emacstheviking <<a href="mailto:objitsu@gmail.com">objitsu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>All I have found is see/seen to see if a file exists. Have I missed something totally obvious ?</div><div>And how about checking the existence of a directory too?</div><div><br></div><div>It feels bad to have to use "see" and then "seen" (to undo see) just to test a file exists.</div><div><br></div><div>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. </div><div><br></div><div>Thanks,</div><div>Sean.</div><div><br></div></div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.mercurylang.org" target="_blank">users@lists.mercurylang.org</a><br>
<a href="https://lists.mercurylang.org/listinfo/users" rel="noreferrer" target="_blank">https://lists.mercurylang.org/listinfo/users</a><br>
</blockquote></div>