![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| command to find out total size of a specific file size (spread over the server) | abhinov | SUN Solaris | 3 | 08-08-2007 03:48 AM |
| Exceed Login | old_tex | HP-UX | 0 | 05-31-2006 08:01 AM |
| Telnet/Exceed | kar1 | UNIX for Dummies Questions & Answers | 1 | 03-01-2005 05:09 AM |
| Exceed | aojmoj | UNIX for Advanced & Expert Users | 2 | 06-21-2003 11:19 PM |
| Exceed subsitutions? | E-Quality | UNIX for Dummies Questions & Answers | 1 | 09-19-2001 07:12 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#8
|
||||
|
||||
|
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. |
| Forum Sponsor | ||
|
|
|
#9
|
||||
|
||||
|
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);
}
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
|
|||
|
|||
|
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
|
|||
|
|||
|
It is working .................
|
|||
| Google The UNIX and Linux Forums |