![]() |
|
|
|
|
|||||||
| 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 |
| File size limit exceeded... SCO ulimit? | rm -r * | UNIX for Dummies Questions & Answers | 1 | 10-22-2007 02:52 PM |
| /tmp: File system full, swap space limit exceeded | frustrated1 | SUN Solaris | 5 | 03-18-2007 01:38 PM |
| Error, Login Limit Exceeded by 1 user | nchrocc | UNIX for Dummies Questions & Answers | 1 | 08-14-2006 06:21 AM |
| File Size Limit | HaidoodFaulkauf | UNIX for Advanced & Expert Users | 2 | 07-25-2006 05:24 AM |
| file size limit | vjm | AIX | 2 | 09-27-2005 06:46 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
File size limit exceeded
When i run my C program which dynamically creates the output file, the program stops after sometime and gives the error "File size limit exceeded" even though my working directory has space.Can anyone plz help me out.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
it seems that you have not handled SIGXFSZ,
check with the following program to find the max size allowed on your system, if needed increase the limits by setrlimit, Code:
# include<stdio.h>
# include <sys/resource.h>
int main()
{
struct rlimit limitbuf;
getrlimit(RLIMIT_FSIZE, &limitbuf);
fprintf(stderr, "Minimum Limit in bytes: %d\n", limitbuf.rlim_cur);
fprintf(stderr, "Maximum Limit in bytes: %d\n", limitbuf.rlim_max);
return 0;
}
i would suggest to change the logging filename after monitoring for a threshold time or file size value. hope this helps. |
|
#3
|
|||
|
|||
|
Thanks for your reply.I got the min and max byte limit.But from what I've read there are limits that can be set using ulimit but when I do a "ulimit -a" the "file size" is already set to unlimited. Is it that the signal SIGXFSZ has already some size defined because of which it is throwing this error?
|
|
#4
|
|||
|
|||
|
This sounds like maybe it is a "large file" problem.
UNIX has actual physical limits to file size determined by the number of bytes a 32 bit file pointer can index, about 2.4 GB. For older filesystems or runtimes. Depending on your system, you may or may not have large file support. Try Code:
man fopen64 If you can't find how or if large file support exists for your box, consider closing the first file just before it reaches 0x7fffffff bytes in length, and opening an additional new file. |
|
#5
|
|||
|
|||
|
Thanks Jim.
Now i am printing my ouput in 5 files.This is the size status of my output files -rw-rw-rw- 1 usr users 53296243 Feb 23 11:09 output -rw-rw-rw- 1 usr users 191 Feb 23 11:09 error -rw-rw-rw- 1 usr users 2701503 Feb 23 11:09 pipe -rw-rw-rw- 1 usr users 255 Feb 23 11:09 summary -rw-rw-rw- 1 usr users 2147483647 Feb 23 11:09 debug The size of the debug file is same as the maximum bytes i got i.e 2147483647(7FFFFFFF) Eventhough the debug file occupies all the max bytes then also other files are created which are pretty large in size.That means the physical limit is exceeded here. Then it should give me that message in unix. But i get this error on linux now. |
|
#6
|
|||
|
|||
|
You debug file is the problem. You are exceeding the file size limit, just like the error message said. The error message is not the issue, the issue is your code. It is trying to do something it is not able to do.
If you have to have one super-large file, then see if your flavor of linux supports 64 bit file pointers - large files. And change your code accordingly. It may involve using a different linux filesystem as well , I do not know. Otherwise, stop writing to the file "debug" when its big, and open a second one "debug2", then when it gets big, write to "debug3" and so on. |
|
#7
|
|||
|
|||
|
Thanks Jim.
Actually my code is too big to make any changes now. But i have tried your other suggestion to create more debug files. But I seriously don't know whether my linux flavour supports 64 bit file pointers or not. My system is redhat linux 7.3 version. Can you please tell me whether it supports or not? |
|||
| Google The UNIX and Linux Forums |