Skip to Content.
Sympa Menu

freetds - Re: [freetds] Freebcp 2GB file limit

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James K.Lowden <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Freebcp 2GB file limit
  • Date: Thu, 28 Oct 2004 22:25:15 -0400

On Thu, 28 Oct 2004 15:50:06 +0200, Michael Peppler <mpeppler AT peppler.org>
wrote:
> On Thu, 2004-10-28 at 15:35, Thompson, Bill D (London) wrote:
> > Tom,
> >
> > That's not a freebcp message , as far as I know.
> > There is a file size limit on your operating system, probably.
> > I have run into the same problem with Sybase "bcp" in Solaris.
>
> Actually it's a bit of both. I think you need to use special calls or
> flags to handle >2GB files.
>
> Checking the open(2) man page on linux I see the O_LARGEFILE flag, for
> example.

Thank you, Michael.

Razzle frazzle snarfle bing-danged nonstandard systems frazzle razzle.

http://www.opengroup.org/onlinepubs/007908799/xsh/open.html

SUS v.2 makes no mention of O_LARGEFILE. off_t is has been a 64-bit
gadget for many years in most OSes.

We don't use open(2); we use fopen(3). There's no special flag to pass to
fopen(3).

http://www.opengroup.org/onlinepubs/007908799/xsh/fopen.html
http://www.opengroup.org/onlinepubs/007908799/xsh/fseek.html

I wonder, short of re-writing, what our options are.

Here's a hint, though, maybe.

http://www.die.net/doc/linux/man/man3/fseeko.3.html

Please try adding:

#define _FILE_OFFSET_BITS 64

to tds.h. Then "make clean; make; make install", and retry your huge
file. If that solves the problem, I'll look into how to make Linux happy
at configure time.

If someone would like to do some research, and find out how to get files
that are opened with fopen(3) in Linux to be more than 2 GB, I'd be happy
to add the proper fix. The right answer, assuming we understand the
problem correctly, would be to fix fopen in Linux's libc.

--jkl







Archive powered by MHonArc 2.6.24.

Top of Page