in reply to Re: file testing is hard
in thread file testing is hard
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: file testing is hard
by dpmott (Scribe) on Dec 01, 2003 at 23:38 UTC |