473,320 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

c program, file size limit, how to solve? 2G bytes limit.

my c program fails to write file that is bigger than 2G bytes. I used
gcc compiler. After writing for a while, It says: "filesize limit
exceed". How to solve this?

But, if I compile the c code by "c++", then it can write more than 2G
bytes in a file. Where is the problem for "gcc"?

the code is here:
---------------------------
#include <stdio.h>
#include <string.h>

int main()
{
char buffer[2281];

FILE* f_p;
f_p = fopen("output.vi", "w");

int i;
for (i = 0; i < 2280; ++i) buffer[i] = 'a';
buffer[i] = '\n';

while(1)
fwrite(buffer, 1, 2281, f_p);

}
------------------------------

Jul 23 '05 #1
1 3168
gu******@gmail.com wrote:
my c program fails to write file that is bigger than 2G bytes. I used
gcc compiler. After writing for a while, It says: "filesize limit
exceed". How to solve this?

But, if I compile the c code by "c++", then it can write more than 2G
bytes in a file. Where is the problem for "gcc"?


Uh... Your problem seems to be either of the "C" sort (in that case ask
in comp.lang.c, down the hall) or of the "GCC" sort (in that case ask in
gnu.gcc.help, around the corner). In either case, I don't see a C++ one.

V
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PeterB | last post by:
Hi! I am using the script below to download files, that are in a non-public directory, from my site. The "smaller files" section works for smaller files. However when the files are getting...
3
by: Ana | last post by:
I have written some code using transient cookies to send an edited essay from one html page to another. Each paragraph of the essay is saved in separate cookie. If the essay is 4 paragraphs long...
9
by: terry | last post by:
I am a programmer (cobol, peoplesoft, sqr, etc.) so I am familiar with programming logic, etc. but not very familiar with C. I need a C program in a study I'm doing. The program is fairly simple,...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
5
by: Claudio Grondi | last post by:
I have just started to play around with the bsddb3 module interfacing the Berkeley Database. Beside the intended database file databaseFile.bdb I see in same directory also the __db.001...
3
by: ramesh | last post by:
can any one help me to solve this one we need to write a c program, Consider a file of size 5000 bytes. Open the file and read to a buffer of size buf; We have to read 1000 bytes only from...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
28
by: tlpell | last post by:
Hey, read some tips/pointers on PHP.net but can't seem to solve this problem. I have a php page that reads the contents of a file and then displays the last XX lines of the file. Problem is...
8
by: Horacius ReX | last post by:
Hi, I am developing some code in C which first I compile on my linux machine and afterwards I test on another special hardware which has almost no debug capabilities at all. Usually I get a lot...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.