Re: Handling errors when working with files
- From: tom@xxxxxxxxxxxxxx (Tom Phoenix)
- Date: Sat, 29 Dec 2007 09:43:37 -0800
On Dec 29, 2007 9:18 AM, oscar gil <racsolig@xxxxxxxxx> wrote:
Using 'open' I cannot say if the 'del' command was done correctly
or not, although there is a message probably to STDERR that I do
not know how to manage. :-(
I believe you're talking about a piped open() to an external command.
The return value from the piped open indicates merely whether the open
itself was successful. The result of the command's execution isn't
available when open returns, because the command has just then been
started, and it may not be done running for some time. Once you're
done running the command, the return value from close() tells you
whether it exited successfully.
Having said that, is the command you're running doing nothing more
important than deleting files and directories? In most cases, you can
do that more quickly, easily, and safely directly from within Perl.
See the unlink and rmdir functions in perlfunc.
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
.
- References:
- Re: Handling errors when working with files
- From: John W. Krahn
- Re: Handling errors when working with files
- From: Oscar Gil
- Re: Handling errors when working with files
- Prev by Date: Re: converting text expressions (like "1+1") to values
- Next by Date: RE: WinXP command prompt window scrolls very slow
- Previous by thread: Re: Handling errors when working with files
- Next by thread: Re: Handling errors when working with files
- Index(es):
Relevant Pages
|