Boost logo

Boost :

From: Jan Hermelink (Jan.Hermelink_at_[hidden])
Date: 2005-07-26 04:56:59


Beman Dawes wrote:
> "Jan Hermelink" <Jan.Hermelink_at_[hidden]> wrote in message
>> Another idea:
>> - Get a WIN32 file handle with CreateFileW()
>> - Get filename from handle:
>>
http://msdn.microsoft.com/library/en-us/fileio/fs/obtaining_a_file_name_
>> from_a_file_handle.asp - use thereby the "Ansi" function to get the
>> "ansi" filename (GetMappedFileNameA())
>>
>> However I have not tested this...
>
> I don't see how that could work unless the codepage is correct, but
> like you I haven't actually tested.

You are right - I have tried this with a file name with greek
characters, and GetMappedFileNameA() failes to translate them correctly:
all greek characters are replaced with '?' (with german system locale).

Yet another idea:
- open file with _wfopen() and get FILE pointer
- construct basic_*fstream with this FILE pointer
  (Dinkumwares (and other) implementation has basic_fstream(FILE*) etc.
as an extension)

Jan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk