What I've learned, through various approaches, is that you want to depend on the result of open() (or sysopen()). A file might exist, for instance, because -e "file" returns true, but you still might not be able to open itBut you then go on to use -r in your code to check if a file is readable with the current effective UID/GID. I was going to point you at exactly that operator to solve your "file exists, can I read it" problem. The various -X operators cover all of the various situations the OP mentioned.
In reply to Re: Re: file testing is hard
by DrHyde
in thread file testing is hard
by jamgill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |