Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread Edscott Wilson
You are absolutely right. I took a look into fcntl.h and there it was. Apparently my configure script is defining NO_OLDNAMES and not defining _POSIX. I dunno why. But the _O_BINARY option works just fine and allows me to avoid the hack with fopen/fileno. Thanks a bunch. Now I can go ahead and r

Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread Ozkan Sezer
On 10/16/13, Edscott Wilson wrote: > 2013/10/16 Ruben Van Boxem > >> 2013/10/16 Edscott Wilson >> >>> >>> 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

Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread Edscott Wilson
2013/10/16 Ruben Van Boxem > 2013/10/16 Edscott Wilson > >> >> 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://

Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread Edscott Wilson
Problem with fseek is: int fseek(FILE *stream, long offset, int whence); While lseek: off_t lseek(int fd, off_t offset, int whence); On 32 bit systems, fseek is limited to 2 GB. Usage of lseek allows for use of off_t, which with mingw-64, will be 64 bit and allow for files > 2 GB. 2013/10/1

Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread niXman
Edscott Wilson писал 2013-10-16 18:53: > ... Since I require use of lseek() ... man fseek -- Regards, niXman ___ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingw-w64/ ___

Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread Ruben Van Boxem
2013/10/16 Edscott Wilson > > 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.a

Re: [Mingw-w64-public] SOLVED Short read mystery

2013-10-16 Thread Edscott Wilson
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. 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.db