7 # when building perl, skip this test if Win32API::File isn't being built
8 if ( $ENV{PERL_CORE} ) {
10 if ( $Config::Config{extensions} !~ m:(?<!\S)Win32API/File(?!\S): ) {
11 print "1..0 # Skip Win32API::File extension not built\n";
18 END { print "not ok 1\n" unless $main::loaded; }
22 use Win32API::File qw(:ALL);
31 my $fh = new Win32API::File "+> foo.txt"
32 or die fileLastError();
35 print "# tell \$fh == '$tell'\n";
40 my $text = "some text\n";
47 print "# after printing 'some text\\n', tell is: '$tell'\n";
49 $tell == length($text) + 1;
62 my $pretty_readline = $readline;
63 $pretty_readline =~ s/\r/\\r/g; $pretty_readline =~ s/\n/\\n/g;
64 print "# read line is '$pretty_readline'\n";
67 $readline eq "some text\r\n";
78 # Test out binmode (should be only LF with print, no CR).
80 $fh = new Win32API::File "+> foo.txt"
81 or die fileLastError();
83 print $fh "hello there\n";
87 <$fh> eq "hello there\n";