I would like to know how can I write a file in
binary mode with win32 API CreateFile, WriteFile.
I'm using these API 'cause I'm reading and
writing with my own buffer by using the
FILE_FLAG_NO_BUFFERING flag.
I search and I can't find nothing that permits me
to change the mode (binary or text)
Can someone help please...
Thank in advance.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Binary and Text mode are high-level concepts connected to the C and C++
standard, and have nothing to do with the native Win32 file system calls.
CreateFile[A|W] and WriteFile must be considered a pure binary-mode
call - they do no processing of the data in the Read/Write buffers, unlike
the _fopen/_fread/_fwrite C-runtime calls.
Floyd Rogers
HANDLE fh = CreateFile( ...)
_osfile(fh) |= FTEXT;
as the Microsoft C Runtime does ...
dann_...@my-deja.com wrote in message <7jiqf7$h8k$1...@nnrp1.deja.com>...
>Hi,
>
>I would like to know how can I write a file in
>binary mode with win32 API CreateFile, WriteFile.
>
>I'm using these API 'cause I'm reading and
>writing with my own buffer by using the
>FILE_FLAG_NO_BUFFERING flag.
>
>I search and I can't find nothing that permits me
>to change the mode (binary or text)
>
Binary/text mode is purely a C runtime concept. There is no counterpart in
the win32 APIs. All I/O to files done with WriteFile is the equivalent of
"binary" mode -- ie, what you pass in is what gets written, verbatim.
Alan Greasley <agre...@adc.metrica.co.uk> wrote in message
news:928924477.5033.0...@news.demon.co.uk...