Max file size can't exceed 2 GB


 
Thread Tools Search this Thread
Top Forums Programming Max file size can't exceed 2 GB
# 8  
Old 02-26-2004
I don't have 64 bit Sun with a compiler. But again, your compiler has a man page. It will tell you how to use 64 bit mode. Or "man lfcompile" will tell you how to write largefiles while in 32 bit mode. You're going to need to read those man pages and follow the instructions.

The first option, using 64 bit mode is the best. You will probably need nothing more than one more option on the cc command line. The option may be phased "use sparcv9 code" or something like that.
# 9  
Old 02-26-2004
I guess that I can do this on a 32 bit sparc and use the technique in the lfcompile man page. First I need a program:

Code:
#include <stdio.h>
main()
{
        FILE *fp;
        int i;
        fp=fopen("bigfile", "w");
        for(i=1; i<107374190; i++)
                fprintf(fp ,"line num=%09d \n", i);
        exit(0);
}

This will try to make a file that is a few bytes larger than 2GB. After, I run it, "tail bigfile ; sleep 4" will show:

line num=107374180
line num=107374181
line num=107374182
line nu

I need that sleep so my prompt did not overwrite the last line which does not end with a newline character. This is where you are, you have a program that can't write a largefile.


Now that "man lfcompile" page say to use "getconf LFS_CFLAGS" to get the flags I need to compile the program. I see that "getconf LFS_CFLAGS" returns
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
but I will just go with:
/opt/SUNWspro/bin/cc `getconf LFS_CFLAGS` makebigfile.c -o makebigfile
to compile my program. All that matters is that I feed those new options into the compiler one way or another. This really seems rather trivial, but this must be where you were stuck.

Now when I rerun the program, bigfile ends with:
line num=107374186
line num=107374187
line num=107374188
line num=107374189
# 10  
Old 02-27-2004
I reached more than this size

Source code :

#include <stdio.h>
#define CHUNKSZ 1048576

int main( int argc, char** argv )
{
int imb;
FILE* fp;
char buf[CHUNKSZ];
memset( buf, 0, CHUNKSZ );

if ( argc < 2 )
{ fprintf( stderr, "Usage: %s temp_file_name\n",
argv[0] ); return 1; }

fp = fopen( argv[1], "w" );

for ( imb=0; imb<11000; imb++ )
{
if ( imb % 100 == 0 )
{ fprintf( stderr, "." ); fflush(stderr); }
fwrite( buf, CHUNKSZ, 1, fp );
}

return 0;
}

------------------------------------------------------------


I compiled this source using your way yesteraday ...it reached this value
-rw-r--r-- 1 tabs tabs 1897119744 Feb 27 12:56 omar.txt

I add also -xarch=v9 to generate 64 bit EXE also it reached the same value

-rw-r--r-- 1 tabs tabs 1897119744 Feb 27 12:56 omar.txt


Sorry I discover that the df -k

/dev/dsk/c1t0d0s6 4129290 4088000 0 100% /homes

and my path is mounted on this

Thanks,,,,Yes I will test yours and mine on large partition to resolve this issue .......

I apologize to you....
# 11  
Old 02-27-2004
MySQL Thanks,,,,

It is working .................Smilie Smilie Smilie Smilie Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Clamd max file size Solaris 10

Hi, I've compiled a 64-bit version of ClamAV 0.98.7 on my Solaris 10 SPARC server. I have a selection of files all containing the eicar signature but clamd is only picking up the signature in the files <2GB. I have the following set in clamd.conf, to remove file size checking: MaxScanSize 0... (4 Replies)
Discussion started by: Troutfest
4 Replies

2. Solaris

ZFS : Can arc size value exceed Physical RAM ?

Hi, kstat -p -m zfs -n arcstats -s size returns zfs:0:arcstats:size 8177310584 this values is approx (7.61 GB) but my Physical Memory size is only 6144 Megabytes. Can this happen ? if yes, then how can I find free memory on the system. BTW, I ran the kstat commands from a Non... (2 Replies)
Discussion started by: sapre_amit
2 Replies

3. Solaris

Exceed XDMCP Query: Menu displayed is tiny size when logged in with language other than English

Hi All, I'm new for Solaris and exceed both. I tried searching in forum but couldn't locate any similar issue posted so posting the issue. I'm remotely connecting a solaris machine using Exceed XDMCP Query and while login I select Chinese language / locale for login. After login when I... (0 Replies)
Discussion started by: kshukla08
0 Replies

4. UNIX for Dummies Questions & Answers

Restrict Max file size

Hello All, I am working on an issue, where I need to check the max file size of a file. If the file size exceeds 2 GB, then I need to generate an error message. Since the file system does not allow a file to be created larger than 2 GB, I am planning to use named pipes & AWK file to acheive my... (6 Replies)
Discussion started by: puru2121
6 Replies

5. UNIX for Dummies Questions & Answers

MAX file size limited to 2GB

Hi All, We are running HP rp7400 box with hpux 11iv1. Recently, we changed 3 kernel parameters a) msgseg from 32560 to 32767 b) msgmnb from 65536 to 65535 c) msgssz from 128 to 256 Then we noticed that all application debug file size increase upto 2GB then it stops. So far we did not... (1 Reply)
Discussion started by: mhbd
1 Replies

6. UNIX for Advanced & Expert Users

Max. file size

i want to know what is the maximum file size supported by linux with ext3 file system. (1 Reply)
Discussion started by: nagalenoj
1 Replies

7. Solaris

max. size of file

I wants to ask that what is the max size of file that we can create in the unix file system. (2 Replies)
Discussion started by: sameerghogre
2 Replies

8. UNIX for Advanced & Expert Users

How to determine the max file size

Does anyone know a way to determine the maximum filesize on a file system on Solaris, HP-UX, AIX, Linux, and OSF1 using the command line? TIA (2 Replies)
Discussion started by: dknight
2 Replies

9. UNIX for Dummies Questions & Answers

Max I/O Size

My HP-UX 11.0 system is supporting an Oracle database. I have found a number of references on the Net to the "Max I/O size" in relation to setting Oracle parameters. How can I tell what my max i/o size is? I originally made the assumption that it was referring to my stripe size but now I think... (1 Reply)
Discussion started by: keelba
1 Replies

10. Shell Programming and Scripting

setting max log file size...

Hello all! I have found a new home, this place is great! I have been searching for days to find a way to set a max size for a log.txt file using a cron job exicuting a shell script. Is it possible for a script to remove older entries in a log file to maintain a limited file size? If so,... (5 Replies)
Discussion started by: v-rod
5 Replies
Login or Register to Ask a Question