![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
How do I open a file without blocking?by faq_monk (Initiate) |
on Oct 08, 1999 at 00:29 UTC ( [id://749]=perlfaq nodetype: print w/replies, xml ) | Need Help?? |
Current Perl documentation can be found at perldoc.perl.org. Here is our local, out-dated (pre-5.6) version:
If you're lucky enough to be using a system that supports non-blocking reads (most Unixish systems do), you need only to use the
O_NDELAY or
O_NONBLOCK flag from the Fcntl module in conjunction with
use Fcntl; sysopen(FH, "/tmp/somefile", O_WRONLY|O_NDELAY|O_CREAT, 0644) or die "can't open /tmp/somefile: $!":
|
|