matrixx515 has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
Attempting to retrieve the fcntl flags for a newly created output file handle using the code below.
The call to fcntl returns:
'Inappropriate ioctl for device'
use strict; use warnings; use Fcntl; my $file_name='/home/dir/temp/test_me.txt'; open my $fh,'>',$file_name || die "can't open $file_name for writing: +$!\n"; my $flags=fcntl $fh,F_GETFL,0 || die "fcntl call failed: $!\n"; print "Flags: $flags\n"; close $fh || die "can't close write handle to $file_name: $!\n";
Thoughts on what I'm missing here? Any, and all ideas are appreciated.
This is my first posted question so please advise (and go easy on me :) ) if there are formatting errors.
Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using fcntl function for the first time
by dave_the_m (Monsignor) on Mar 11, 2015 at 22:24 UTC | |
|
Re: Using fcntl function for the first time
by Anonymous Monk on Mar 11, 2015 at 22:30 UTC | |
by runrig (Abbot) on Mar 11, 2015 at 22:36 UTC | |
|
Re: Using fcntl function for the first time
by matrixx515 (Acolyte) on Mar 11, 2015 at 23:18 UTC |