Re: file open question
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Sun, 15 May 2005 18:29:17 GMT
r_stringer66@xxxxxxxxx wrote:
> I want to write a simple perl script which checks to see if a given
> file exists if so it will do one thing and if not something else,
"perldoc -f -X" and pay particular attention to the "-e" test.
> So far I looked at perl's open function but it does not seem to return
> a boolean in order to indicate of the file was opened successfully or
> not.
Why do you think so? Did you check the documentation for the functions you
are using?
>From "perldoc -f open":
Open returns nonzero upon success, the undefined value
otherwise. [...]
To me this sounds very much like what you were looking for in your last
paragraph.
However, please notice that there is a significant difference between what
you were asking for in the first paragraph (file exists) and what you are
asking for in the last paragraph (file can be opened for whatever).
jue
.
- References:
- file open question
- From: r_stringer66
- file open question
- Prev by Date: Re: Need help with perl script using threads.
- Next by Date: Re: file open question
- Previous by thread: Re: file open question
- Next by thread: Re: file open question
- Index(es):
Relevant Pages
|