stat() fails for large file (2GB)

A

Alona

Hi All,

stat fails on a 2GB file with errno=EOVERFLOW.
Is there a way to run stat() on a large file?

Thanks,
Alona
 
S

santosh

Alona said:
Hi All,

stat fails on a 2GB file with errno=EOVERFLOW.
Is there a way to run stat() on a large file?

Stat is not defined by ISO C, so you might want to ask in
comp.unix.programmer.

<OT>
Use stat64. See your system's documentation for the C library or the
online documentation for POSIX.
</OT>
 
A

Alona

Stat is not defined by ISO C, so you might want to ask in
comp.unix.programmer.

<OT>
Use stat64. See your system's documentation for the C library or the
online documentation for POSIX.
</OT>

stat64() works, but S_ISREG returns that the file is not a regular
file, while it is a regular text file.
 
S

santosh

Alona said:
stat64() works, but S_ISREG returns that the file is not a regular
file, while it is a regular text file.

You *really* should post this to a group that's specific to your
environment like <
Also WRT my previous advice you should probably define _FILE_OFFSET_BITS
to 64 and use stat in a transparent manner.
 
C

CBFalconer

Alona said:
stat fails on a 2GB file with errno=EOVERFLOW.
Is there a way to run stat() on a large file?

STAT is a CP/M system program. The system doesn't handle 2GB files.
 
I

Ian Collins

CBFalconer said:
STAT is a CP/M system program. The system doesn't handle 2GB files.
Which is probably why the OP is using a system with a function named
stat. In case you hadn't noticed, C is case sensitive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top