c_chipster has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I was reading How do I tell if a handle is open for writing?. Although the thread didn't go down that way, but the guy sort of indicated that select can be used on normal files. I don't think so though. For example, the following code always prints -1 - nothing writable:
use strict; use warnings; use IO::Select; my $file; open $file, ">", "somefile"; my $sel = IO::Select->new(); $sel->add($file); my @writables= $sel->can_write(); print $#writables;
Can anyone demo the opposite?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Select and file handler
by pg (Canon) on Nov 13, 2005 at 22:18 UTC | |
by ikegami (Patriarch) on Nov 14, 2005 at 13:57 UTC | |
|
Re: Select and file handler
by graff (Chancellor) on Nov 13, 2005 at 21:02 UTC | |
|
Re: Select and file handler
by Tanktalus (Canon) on Nov 13, 2005 at 20:53 UTC | |
|
Re: Select and file handler
by gaal (Parson) on Nov 13, 2005 at 20:53 UTC |