The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fetchmail - log file size limitation DILEEP410 Shell Programming and Scripting 10 05-20-2008 07:41 AM
Size limitation in Tar command Manvar Khan Shell Programming and Scripting 4 07-20-2007 09:19 AM
File size limitation for rcp schoubal Linux 2 01-14-2006 01:58 AM
HP-UX 11i - File Size Limitation And Number Of Folders Limitation sundeep_mohanty HP-UX 2 08-01-2005 07:58 PM
unix group file limitation asmillie SUN Solaris 3 06-28-2005 10:13 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-05-2005
cskumar cskumar is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 67
File size limitation of unix sort command.

hi ,

iam trying to sort millions of records which is delimited and i cant able to
use sort command more than 60 million..if i try to do so i got an message stating that "File size limit exceeded",Is there any file size limit for using sort command..
How can i solve this problem.

thanks

cskumar
  #2 (permalink)  
Old 10-05-2005
pixelbeat pixelbeat is offline
Registered User
  
 

Join Date: Jun 2005
Location: Ireland
Posts: 61
what version of unix/sort exactly?
gnu sort for example supports files > 2GB,
and efficiently sorts/merges files > RAM size
  #3 (permalink)  
Old 10-05-2005
cskumar cskumar is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 67
Hi Pixelbeat,

Thanks for your quick response. We are trying this on HP UX 11. We are generating input file for sorting through c program and calling unix sort command through c only, as follows::

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

FILE *fout;
int main(int argc,char *argv[])
{
int loopcnt=0;
unsigned long int TTRECS = 60000000;

if((fout = fopen("SORTINPUT","w")) == NULL)
{
printf("\nUnable to open the output_file file\n");
exit(1);
}
for (loopcnt=TTRECS;loopcnt>=1;loopcnt--)
{
fprintf(fout,"%d|%s%d|%s|\n",loopcnt,"Dummy",loopcnt,"Dummy Description");
}
fflush(fout);
printf("Executing::sort -t '|' -k 1,1 SORTINPUT> sorttestoutput\n");

system("echo Sort Start Time;date");
system("sort -t '|' -k 1,1 SORTINPUT > sorttestoutput");
system("echo status returned::$?");

system("echo Sort End Time;date");
printf("Total Records Configured:: %lu\n", TTRECS);
return 0;
}


We are trying this test just to make sure that unix sort command is not having any limitations on file size. But what we observed is when file is packed with more than 60 million records [ around 2 Gb size], we are getting an error stating "File size limit exceeded" on console. Can u kindly state,

1] whether we got any maximum file size limit in HP UX while creating a file through C program.

2] Can unix sort command can handle file size > 2 GB without any failure.

3] Is there any restriction for length of each record [each line] or each field[fields are separated by a delimeter].

Thanks,
  #4 (permalink)  
Old 10-06-2005
chlorine chlorine is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 12
Quote:
Originally Posted by cskumar
Hi Pixelbeat,


1] whether we got any maximum file size limit in HP UX while creating a file through C program.
I think it's quite possible that you have such a file size limitation.
If I were you I'd try to edit your C code to see if the error occurs before the sort
command is called or not. I'd say it's before it, because I think the error might
begin by "sort: " if the error was caused by sort.
  #5 (permalink)  
Old 10-06-2005
cskumar cskumar is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 67
thanks for ur reply chlorine,

Yes as u said error is before sort only as we couldn't create a file of size more than 2 GB through c.
[1] Can u suggest a way to get rid of that size problem.

[2] Can u let us know whether we got any such file size limitation for sort command.
  #6 (permalink)  
Old 10-06-2005
chlorine chlorine is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 12
I have no idea if it is feasible to change the filesize limit.
For sort, the man page should tell you exactly the limitations. If the man page doesn't mention any limitations then there should be none.
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0