Re: File Size Limit Exceeded - How to handle work around this?
- From: "eastcoastguyz" <eastcoastguyz@xxxxxxxxxxx>
- Date: 13 Dec 2006 13:26:05 -0800
Michael wrote:
I wrote a simple program to continue to create a very large file (on
purpose), and even though there is plenty of disk space on that device
the program aborted with the error message "File Size Limit Exceeded".
The file size was 2147483647. I checked ulimit -a and its set to
unlimited.
Is this a compiler issue? I would like to see a C code example of how
to increase the limit or make it unlimited (if that is a wise thing to
do).
It's been a long time, though, so this advice may be dated.
A long time ago, when the Linux 2.4 kernel was new (i.e., when 64-bit
file sizes were just starting to catch on), we used to have this same
problem. Back then, you had to compile with some special symbol
defined, LARGE_FILES or something like that. That caused the typical
file size types (offset_t and the like) to be 64 bit. You might find
something like that in the compiler documentation.
Of course, to narrow it to OS or C, you could have your program write
to stdout and redirect to a file. If it still doesn't work, you have
an OS problem. And if it isn't C, it could be your OS kernel, or your
shell, or your filesystem (e.g., NFS) that has some kind of limit in
it.
Michael
Thanks for the suggestion. I made another version of this C program,
where it writes to standard output and piped the output to a file. It
had no problem creating a file size over 3GB, exceeding the 2GB limit I
encountered.
This system is using gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) which
is what came with the latest version of CentOS. The kernel is:
[root@localhost proc]# cat /proc/version
Linux version 2.6.9-42.0.3.EL (buildsvn@build-i386) (gcc version 3.4.6
20060404
.
- Follow-Ups:
- References:
- File Size Limit Exceeded - How to handle work around this?
- From: eastcoastguyz
- Re: File Size Limit Exceeded - How to handle work around this?
- From: Michael
- File Size Limit Exceeded - How to handle work around this?
- Prev by Date: Re: referring to struct members by number. - TPA
- Next by Date: Re: Are enormous malloc()s conforming?
- Previous by thread: Re: File Size Limit Exceeded - How to handle work around this?
- Next by thread: Re: File Size Limit Exceeded - How to handle work around this?
- Index(es):
Relevant Pages
|