From: Jonathan Ultis (jonathanu_at_[hidden])
Date: 2004-02-10 00:01:10
Since you asked, I did some more reading. My bug report should have
included "on 32 bit linux systems". And, it's possible to get stat to
work for large files by using the correct defines. There could be
linking problems if you do, but it's not likely to be a big concern. So,
consider this a robustness patch. This will make exists () work on large
files, even for goobers like me that don't have their compile set up to
support large files.
If you were extremely interested in supporting all configurations, there
are also certain defines that can be set which cause large file support
to be offered through an alternate set of function names, which can be
useful for maintaining binary compatibility with pre-compiled libraries.
Using that define and the alternate names would be a safe way to make
the filesystem library work on 64bit files no matter what defines are
used to compile. But, it's probably not worth the hassle if no one has
The linux gazette article at www.linuxgazette.com/issue67/tag/13.html
was interesting, if you want to follow up on this. But, it basically
said to read info on libc and look for LFS or large file support. Doing
so was also interesting.
Beman Dawes wrote:
> At 01:35 AM 2/9/2004, Jonathan Ultis wrote:
> >::exists is implemented using ::stat. The ::stat routine returns an
> >error on file sizes larger than 2 gigs in libc-2.3.2, and several
> >others. So, very large files never exists (). Using ::access seems to
> >fix the problem.
> Good grief! Are you saying that ::stat() cannot be used at all because
> it fails for all uses when file sizes are larger than 2 gigs?
> That would be a disaster. The filesystem library uses stat in at least
> 6 other places. I would guess that stat() is one of the most heavily
> used POSIX functions dealing with files, and that software from here
> to Antarctica to Mars would fail regularly if stat() failed for large
> files. Hum... Didn't I just hear something about filesystems on Mars:-?
> I don't mean to doubt your report, but it seems hard to believe that
> such a commonly used function could fail for large files. Is there
> more to the story?
> PS: Your suggestion to use access() seems quite reasonable and
> harmless for exists(), but I haven't looked at the other filesystem
> uses to see if it could be uniformly applied.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk