Operating System - HP-UX
1833346 Members
2911 Online
110051 Solutions
New Discussion

Problem with using 'stat' on large files

 
SOLVED
Go to solution
Beetlejuice
Occasional Contributor

Problem with using 'stat' on large files

Hi!

I am attempting to use the 'stat' command within a C program in order to retrieve date/time information on a file. The file is larger than 2 gigabytes in size (I'm running on HP-UX 10.20). When I dig deeper, the errno returned from my 'stat' command is 72:
"define EOVERFLOW: Value too large to be stored in data type"

Is there a version of 'stat' that will allow me to work with files larger than 2GB on my system? Or...is there another approach I may need to take?

Thanks!
Brent
4 REPLIES 4
Sanjay_6
Honored Contributor
Beetlejuice
Occasional Contributor

Re: Problem with using 'stat' on large files

Sanjay:

Thanks for the threads; however, they both seem to apply to a system running HPUX 11. I'm looking for a solution that will work on my 10.20 box...although I might be able to use the 64-bit application on my 32-bit system.

Any other ideas?
Brent
Sanjay_6
Honored Contributor
Solution

Re: Problem with using 'stat' on large files

Hi Brent,

Have a look at this thread. This is for UX 10.20

http://us-support2.external.hp.com/cki/bin/doc.pl/sid=d2707c010fd2fba8ed/screen=ckiDisplayDocument?docId=200000023740214

Hope this helps.

thanks
A. Clay Stephenson
Acclaimed Contributor

Re: Problem with using 'stat' on large files

Hi Brent:

You need to use the stat64() system call which returns its data into a stat64 struct. This will fix your problem although this is a non-POSIX solution.
If it ain't broke, I can fix that.