problem with opening up huge sized file
Michael Fowler
michael at shoebox.net
Sun Jan 21 05:22:34 CST 2001
On Fri, Jan 19, 2001 at 11:56:17PM -0800, Rick J wrote:
> I was trying to open up a 2.6G file on Unix Solaris
> 5.6, 32bit. Perl barfed out "Variable value too
> large."
Can you post the exact code you're using? Preferably the smallest amount
that will duplicate the error. I'm thinking your issue is with large file
support in perl, or the lack thereof.
The perl -V output as Arthur mentioned would also be helpful.
> I thought it was memory problem, cuz I believed that
> when PERL opens up a file, it reads whole content into
> its memory.
When perl opens a file it doesn't do any reading. You the programmer have
to do the reading if you want to get any data. It's up to you how much of
the file you read in at a time.
> But someone thought it's the OS problem,
> because my Solaris is 32bit, and it can only handle
> the file smaller than 2.6G something. It it's true,
> why I can open the file with 'textedit' or 'vi' or
> even with command like 'more' or 'grep' search?
It's not necessarily an OS problem, more of a problem with perl interfacing
with your OS. What I'm guessing the problem is is that your perl was not
compiled with large file support. Originally, the C library functions that
dealt with file sizes (stat, seek, tell, etc.) had an upper limit on the
file size they could deal with. In order to preserve backwards
compatability with older programs that used these functions, many C
libraries also define equivalent functions that deal with increased file
sizes. On the systems with such C libraries the program (perl, grep, vi,
etc.) has to use these equivalent functions, or set certain macros during
compilation, in order to properly deal with large files.
However, I'm guessing here. I can't say for sure until I see your program
and your perl -V output.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
=================================================
Mailing list info: If at any time you wish to (un|re)subscribe to
the list send the request to majordomo at hfb.pm.org. All requests
should be in the body, and look like such
subscribe anchorage-pm-list
unsubscribe anchorage-pm-list
More information about the Anchorage-pm
mailing list