[prog] fopen and large files (RH9)
Conor Daly
c.daly at met.ie
Sat Jan 15 05:49:16 EST 2005
Hi all,
Having downloaded the latest ingres database software (now opensource under
CA's 'trusted' license), I've come up against a problem trying to load a 4Gb
table. I have a file about 4Gb in size on an ext3 filesystem on an RH9
system. The ingres 'copy' command should read this file and load it into a
table. Instead it fails with 'cant open file'. After much testing and
discovering that this occurred only for files > 2GB, I downloaded the
sources and started delving. The problem occurs with a call to
fopen(loc->string, fmode) which should come out as fopen(<filename>, "rc").
Reading 'man fopen' I see:
The fopen function may also fail and set errno for any of the
errors specified for the routine open(2).
and 'man 2 open' says:
int open(const char *pathname, int flags);
The parameter flags is one of O_RDONLY, O_WRONLY or O_RDWR which
request opening the file read-only, write-only or read/write, respec-
tively, bitwise-or-ed with zero or more of the following:
O_LARGEFILE
On 32-bit systems that support the Large Files System, allow
files whose sizes cannot be represented in 31 bits to be opened.
I presume this is my problem. Now, doing an 'rpm -qi ca-ingres' I see the
build host is called: hanje04-sles8.ca.com and the 'sles8' leads me to
suspect that it was built on a Suse enterprise 8 machine. Does that support
large filesystems? Is there a call to make I can use to get open(2) to use
the O_LARGEFILE flag?
Urrgh!!
Conor
--
Conor Daly, Please avoid sending me
Met Eireann, Glasnevin Hill, Word or PowerPoint attachments.
Dublin 9, Ireland http://www.fsf.org/philosophy/no-word-attachments.html
Ph +3531 8064276 Fax +3531 8064247
**********************************************************************
This e-mail and any files transmitted with it are confidential
and intended solely for the addressee. If you have received
this email in error please notify the sender.
This e-mail message has also been scanned for the
presence of computer viruses.
**********************************************************************
More information about the Programming
mailing list