Determine the mode of open files in Windows

The following code will give you the opening mode of the given handle ( <

, >

etc.):

use Fcntl qw(F_GETFL);
my $flags = fcntl($fh, F_GETFL, my $junk);

      

$flags

is a number indicating open mode (numbers defined by other macros provided by Fcntl). This, however, does not work on a Strawberry Perl installation. It fails with the following message:

Your vendor has not defined Fcntl macro F_GETFL

      

How can this be done when installing Windows on Perl?

The context is that I am looking into a fix for Data :: Transform :: ExplicitMetadata . Its purpose is to make Perl structures serializable via JSON, and one thing that needs to be done to serialize is open file descriptors. See the current code here .

+3
windows perl filehandle


source to share


No one has answered this question yet

Check out similar questions:

2453
How do I install pip on Windows?
2195
Is there an equivalent to "which" on the Windows command line?
1975
How do I know which process is listening on a port on Windows?
1141
How can I develop for iPhone using Windows development machine?
1023
Text editor for opening large (giant, large, large) text files
973
Ignoring directories in Git repos on Windows
951
Node.js / Windows Error: ENOENT, stat 'C: \ Users \ RT \ AppData \ Roaming \ npm'
706
Windows batch files: .bat vs .cmd?
652
Redirect Windows cmd stdout and stderr to one file
3
Strawberry Perl: Forgetting environment variables?



All Articles
Loading...
X
Show
Funny
Dev
Pics