2013/10/16 Edscott Wilson <[email protected]>

>
> I appreciate all the responses. This is the result.
>
> 1. The option O_BINARY is not available in fcntl.h for gcc, So
> open("test.dbh", O_RDWR|O_BINARY) does not work.
>

See MSDN for the flags you are looking for:
http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx

Ruben


>
> 2. Neither will the unix2dos program work since the file to open is a
> binary file which must be read byte by byte.
>
> 3. fopen("test.dbh", "rb") seems to have nailed it. Since I require use of
> lseek() later on, I need a file descriptor. So the solution (hack?) that
> works is the following:
> FILE *f = fopen("test.dbh", "rb");
> int fd = fileno(f);
>
> With that, the read(fd, data, 256) will read the correct amount of bytes.
>
> Thanks!
>
>
>
> --
>
> ------------------------------------------------------------------------------------
> Dr. Edscott Wilson Garcia
> Applied Mathematics and Computing
> Mexican Petroleum Institute
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to