Um, actually, Win32API::File does have CreateFileW(), just not mentioned in the documentation.
my $wPath= pack "S*", unpack( "C*", "C:/server/htdocs/DEVELOPMENT/testing/" ), 19968, 26869, 39640, 26641, unpack( "C*", "/test/test.ssi" ), 0; my $hFile= CreateFileW( $wPath, GENERIC_READ()|GENERIC_WRITE(), FILE_SHARE_READ()|FILE_SHARE_WRITE(), [], OPEN_EXISTING(), 0, [] ) or die "Can't open: $^E\n"; OsFHandleOpen( *DATFILE, $hFile, "rw" ) or die "Can't create Perl handle: $!\n"; my $strHeaderLine = <DATFILE>; print $strHeaderLine; close DATFILE;
Note, this code is untested because I composed it under Linux.
Update: I need to update createFile() to detect UTF-8 path names and do all this for you...
- tye
In reply to Re^2: Problems Opening file with Perl where path has UTF8 (d'oh!)
by tye
in thread Problems Opening file with Perl where path has UTF8
by lustyx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |