Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-22-2006, 01:56 AM
|
#1
|
|
LQ Newbie
Registered: Nov 2006
Posts: 1
Rep:
|
Maximum file size
Does anyone know what is the maximum file size that can
be parsed by the AWK / or by linux in general?
|
|
|
|
11-22-2006, 04:58 AM
|
#2
|
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,211
Rep: 
|
linux file sizes, pretty large about 1TB i believe,
awk, dependent on memory and awk itself, dunno
with perl i have parsed very large files
|
|
|
|
11-22-2006, 05:38 AM
|
#3
|
|
Member
Registered: May 2002
Posts: 964
Rep:
|
Unless you mean "line size" -- which is usually thought of as the number of bytes per record in a text-formatted file -- if the filesystem can store the file, then utilities like awk and sed can read it.
What error are you getting?
|
|
|
|
11-22-2006, 05:39 AM
|
#4
|
|
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530
Rep:
|
I once ran into a 2 GiB limit with awk on a HP-UX machine. I think it depends on which c library it was compiled against. You can probably tell by looking for the 64 bit file IO functions in the binary:
Code:
strings $(which awk) |grep fopen
If you see fopen64, I think you should be OK up to files of stupidly large size. If you see regular fopen, probably you'll hit the limit at 2 GiB.
|
|
|
|
11-22-2006, 08:34 PM
|
#5
|
|
Member
Registered: May 2004
Posts: 552
Rep:
|
sed also counts line numbers, there could be an issue if there is more than 2^32 lines streamed in or read from a file. I don't know if the following works, to print the 2^32 line number?? Anyone have a file this big laying around?
|
|
|
|
11-22-2006, 10:28 PM
|
#6
|
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,006
Rep: 
|
The most general answer is as many bytes as you can index with an off_t.
|
|
|
|
11-23-2006, 12:16 AM
|
#7
|
|
Member
Registered: Jun 2005
Posts: 542
Rep:
|
Quote:
|
Originally Posted by tuxdev
The most general answer is as many bytes as you can index with an off_t.
|
Yes, it's the most reliable way. This and off64_t. As a matter of fact, the *BSD's lack fopen64() because they use a 64-bits wide off_t.
|
|
|
|
11-24-2006, 07:54 AM
|
#8
|
|
Member
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383
Rep:
|
And fopen64 is a non-standard function, to support 64-bit file pointers
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:18 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|