#! perl -slw use strict; use Inline C => 'DATA', NAME => 'fmode', CLEAN_AFTER_BUILD => 0; open FILE, $ARGV[0] or die "'$ARGV[0]:$!"; printf "%x\n", fmode( \*FILE ); __DATA__ C:\test>fmode "fmode ">junk.dat" 2 C:\test>fmode ">>junk.dat" 2 C:\test>fmode "+fmode "+>junk.dat" 80 C:\test>fmode "+>>junk.dat" 80 __C__ int fmode( FILE *stream ) { return stream->_flag; } #### C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap C:\Perl\lib\ExtUtils\typemap Fmode.xs > Fmode.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e mv Fmode.xsc Fmode.c Error: Cannot parse function definition from 'fmode( FILE *stream ) {' in Fmode.xs, line 12