[.courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
garyf@chimera-f.convex.com (Gary Faulkner) writes:
:Hello all,
:
:Since I didn't seem to see this in a FAQ or any of the multitudes of postings
:in this newsgroup, I figured I'd just ask the group.
:
:Has anyone done any work to get perl5 to handle (from all aspects) files
:greater than 2 gig (i.e. 64 bit off_t and stat->st_size)?? I have managed to
:modify the source so that the appropriate calls and stat structures/off_t types
:are used internally; however, I cannot seem to get perl to recognize that the
:arguements to seek(), the return from tell(), or the st_size member of the
:array returned by stat()/fstat() are 64 bit quantities.
:
:(yes, the O/S's I am porting to support these values)...
:
:For example, if I do a :
:
:@statstr = stat("/largefiles/3gigfile");
:print ("@statstr\n");
:
:The size member is invalid (I'm sure because I'm only picking up the low order
:word of the stat->st_size member).
:
:I would appreciate pointers from anyone (even to a missed piece of
:documentation) on what to do to externalize these values.
Fascinating.
I'll bet that the problem is that in your sys/stat.h, you have st_size has
an off_t, and that an off_t is acutally a 64 bit quantity, like a long
long, not just a 32 one. And yet the perl source, in pp_sys.c around line
1741 says:
PUSHs(sv_2mortal(newSViv((I32)statcache.st_size)));
which is going to be a problem. I don't know of a good solution, either.
I suppose tell and seek and stuff take I64 off_t's as well for you.
CC'd to perl-porters, as this really does seem a porting issue.
--tom
--
Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
if (shm == (char *)-1) /* I hate System V IPC, I really do */
--Larry Wall, from doio.c in the v5.0 perl distribution
In comp.lang.perl.misc,
garyf@chimera-f.convex.com (Gary Faulkner) writes:
:Hello all,
:
:Since I didn't seem to see this in a FAQ or any of the multitudes of postings
:in this newsgroup, I figured I'd just ask the group.
:
:Has anyone done any work to get perl5 to handle (from all aspects) files
:greater than 2 gig (i.e. 64 bit off_t and stat->st_size)?? I have managed to
:modify the source so that the appropriate calls and stat structures/off_t types
:are used internally; however, I cannot seem to get perl to recognize that the
:arguements to seek(), the return from tell(), or the st_size member of the
:array returned by stat()/fstat() are 64 bit quantities.
:
:(yes, the O/S's I am porting to support these values)...
:
:For example, if I do a :
:
:@statstr = stat("/largefiles/3gigfile");
:print ("@statstr\n");
:
:The size member is invalid (I'm sure because I'm only picking up the low order
:word of the stat->st_size member).
:
:I would appreciate pointers from anyone (even to a missed piece of
:documentation) on what to do to externalize these values.
Fascinating.
I'll bet that the problem is that in your sys/stat.h, you have st_size has
an off_t, and that an off_t is acutally a 64 bit quantity, like a long
long, not just a 32 one. And yet the perl source, in pp_sys.c around line
1741 says:
PUSHs(sv_2mortal(newSViv((I32)statcache.st_size)));
which is going to be a problem. I don't know of a good solution, either.
I suppose tell and seek and stuff take I64 off_t's as well for you.
CC'd to perl-porters, as this really does seem a porting issue.
--tom
--
Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
if (shm == (char *)-1) /* I hate System V IPC, I really do */
--Larry Wall, from doio.c in the v5.0 perl distribution