[Zope-dev] >2GB Data.fs files on FreeBSD
Andrew M. Kuchling
akuchlin@mems-exchange.org
Thu, 13 Apr 2000 17:29:08 -0400 (EDT)
R. David Murray writes:
>So it looks to my uneducated eye like file.tell() is broken. The actual
>on-disk size of the file, by the way, is indeed 2147718485, so it looks
>like somebody's not using the right size data structure somewhere.
Look at Objects/fileobject.c, at the implementation for tell().
(The Python source code is nicely organized; don't be afraid to dive
into it.)
#if defined(HAVE_FTELLO) && defined(HAVE_LARGEFILE_SUPPORT)
offset = ftello(f->f_fp);
#elif defined(HAVE_FTELL64) && defined(HAVE_LARGEFILE_SUPPORT)
offset = ftell64(f->f_fp);
#else
offset = ftell(f->f_fp);
#endif
So, presumably neither HAVE_FTELLO nor HAVE_FTELL64 are defined, so it
uses the old ftell(). What's the right system call for FreeBSD?
Looking at the man pages for 4.0 at freebsd.org, it's ftello(). So,
is HAVE_FTELLO defined? If it isn't, then find out why; if it is,
then there's some other bug in Python's tell() code.
--
A.M. Kuchling http://starship.python.net/crew/amk/
From gotos to the evolution of life in 10 posts; that's comp.lang.python for
you!
-- A.M. Kuchling, 4 Apr 1998