Hi all,
I've got a C program which outputs all its data using a statement of
the form:
putchar(ch, outfile);
This has worked fine for years until it had to output more than 2GB of
data today, and I got a "file size limit exceeded" error.
On a whim I tried setting 'outfile' to 'stdout' (and piped output
using the bash '> outfile'), and it worked.
Now since it works, it's not really urgent. But I'm curious: what's
going on here? I've read that the "file size limit exceeded" error is
due to my OS (which is Linux, 2.4 I think), but then why should the OS
care whether the file is opened and closed inside my C program (when
it didn't work) or in bash (when it did work)? Is the problem due to
some pointer size limit in my machine's implementation of C (the
program was compiled using gcc)? Or something else?
Just wondering.
Regards,
Peter Ballard
Adelaide, AUSTRALIA pb******@ozemai l.com.au http://www.ozemail.com.au/~pballard/ 8 18751
On 30 Jul 2003 20:37:23 -0700, pb******@ozemai l.com.au (Peter Ballard)
wrote in comp.lang.c: Hi all,
I've got a C program which outputs all its data using a statement of the form:
putchar(ch, outfile);
This has worked fine for years until it had to output more than 2GB of data today, and I got a "file size limit exceeded" error.
On a whim I tried setting 'outfile' to 'stdout' (and piped output using the bash '> outfile'), and it worked.
Now since it works, it's not really urgent. But I'm curious: what's going on here? I've read that the "file size limit exceeded" error is due to my OS (which is Linux, 2.4 I think), but then why should the OS care whether the file is opened and closed inside my C program (when it didn't work) or in bash (when it did work)? Is the problem due to some pointer size limit in my machine's implementation of C (the program was compiled using gcc)? Or something else?
Just wondering.
Please use a proper signature block, like mine, that begins with a
line with the three characters "-- ", so proper newsreaders will
automatically snip it when replying.
As to file size limitations, they have nothing at all to do with the C
standard and everything to do with your compiler and/or operating
system. You need to ask in a group like
news:comp.os.li nux.development .apps.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.l earn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
"Peter Ballard" <pb******@ozema il.com.au> wrote in message
news:9d******** *************** **@posting.goog le.com... Hi all,
I've got a C program which outputs all its data using a statement of the form:
putchar(ch, outfile);
This has worked fine for years until it had to output more than 2GB of data today, and I got a "file size limit exceeded" error.
On a whim I tried setting 'outfile' to 'stdout' (and piped output using the bash '> outfile'), and it worked.
Now since it works, it's not really urgent. But I'm curious: what's going on here?
(snip)
The C library routines allow fseek() calls to be made on the file. The
system doesn't know that you aren't doing any fseek().
The position argument to fseek() is an int. To prevent problems that could
occur, the system limits file size.
-- glen
In <zv2Wa.16407$Oz 4.6184@rwcrnsc5 4> "Glen Herrmannsfeldt" <ga*@ugcs.calte ch.edu> writes: "Peter Ballard" <pb******@ozema il.com.au> wrote in message news:9d******* *************** ***@posting.goo gle.com... Hi all,
I've got a C program which outputs all its data using a statement of the form:
putchar(ch, outfile);
This has worked fine for years until it had to output more than 2GB of data today, and I got a "file size limit exceeded" error.
On a whim I tried setting 'outfile' to 'stdout' (and piped output using the bash '> outfile'), and it worked.
Now since it works, it's not really urgent. But I'm curious: what's going on here? (snip)
The C library routines allow fseek() calls to be made on the file. The system doesn't know that you aren't doing any fseek().
So what? fseek() is allowed to fail.
The position argument to fseek() is an int. To prevent problems that could occur, the system limits file size.
Nonsense! That's what fsetpos() is for.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
In <9d************ *************@p osting.google.c om> pb******@ozemai l.com.au (Peter Ballard) writes: I've got a C program which outputs all its data using a statement of the form:
putchar(ch, outfile);
This has worked fine for years until it had to output more than 2GB of data today, and I got a "file size limit exceeded" error.
On a whim I tried setting 'outfile' to 'stdout' (and piped output using the bash '> outfile'), and it worked.
Now since it works, it's not really urgent. But I'm curious: what's going on here? I've read that the "file size limit exceeded" error is due to my OS (which is Linux, 2.4 I think), but then why should the OS care whether the file is opened and closed inside my C program (when it didn't work) or in bash (when it did work)? Is the problem due to some pointer size limit in my machine's implementation of C (the program was compiled using gcc)? Or something else?
Just a guess. Your system has large file support, but it is not enabled
by default. When fopen() calls open(), it doesn't specify whatever magic
is necessary for enabling the large file support. When bash opens a file,
it does.
The magic is actually documented in the open(2) man page.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
In <vi************ @corp.supernews .com> Derk Gwen <de******@HotPO P.com> writes: # Now since it works, it's not really urgent. But I'm curious: what's # going on here? I've read that the "file size limit exceeded" error is # due to my OS (which is Linux, 2.4 I think), but then why should the OS # care whether the file is opened and closed inside my C program (when # it didn't work) or in bash (when it did work)? Is the problem due to # some pointer size limit in my machine's implementation of C (the # program was compiled using gcc)? Or something else?
Are you sure it's the kernel or stdio? You can bypass stdio and use open and write calls to check if it also fails at 2GB.
How do you suppose stdio is actually performing its I/O?
Next time, engage your brain before posting.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
In article <9d************ *************@p osting.google.c om>, pb******@ozemai l.com.au says... Now since it works, it's not really urgent. But I'm curious: what's going on here? I've read that the "file size limit exceeded" error is due to my OS (which is Linux, 2.4 I think), but then why should the OS care whether the file is opened and closed inside my C program (when it didn't work) or in bash (when it did work)? Is the problem due to some pointer size limit in my machine's implementation of C (the program was compiled using gcc)? Or something else?
That's OT for this newsgroup (comp.os.linux. development.* for example)
however, a google search for "LFS" "Large file summit", 2GB, etc.
will probably lead you to the right answer as well.
Randy Howard <ra**********@F OOmegapathdslBA R.net> wrote in message news:<MP******* *************** **@news.megapat hdsl.net>... In article <9d************ *************@p osting.google.c om>, pb******@ozemai l.com.au says... Now since it works, it's not really urgent. But I'm curious: what's going on here? I've read that the "file size limit exceeded" error is due to my OS (which is Linux, 2.4 I think), but then why should the OS care whether the file is opened and closed inside my C program (when it didn't work) or in bash (when it did work)? Is the problem due to some pointer size limit in my machine's implementation of C (the program was compiled using gcc)? Or something else? That's OT for this newsgroup (comp.os.linux. development.* for example)
Probably. But in my defence, my problem was unique to my C program.
(bash was fine making >2GB; as were test programs in two other
languages which I tried since my 1st post).
however, a google search for "LFS" "Large file summit", 2GB, etc. will probably lead you to the right answer as well.
Thanks to all who responded. This URL seems to cover the issue fairly
well: http://www.suse.de/~aj/linux_lfs.html
--
Regards,
Peter Ballard
Adelaide, AUSTRALIA pb******@ozemai l.com.au http://www.ozemail.com.au/~pballard/
In article <9d************ **************@ posting.google. com>, pb******@ozemai l.com.au says... That's OT for this newsgroup (comp.os.linux. development.* for example)
Probably. But in my defence, my problem was unique to my C program.
It could have also happened with any language using 32bit file offsets.
Still doesn't make it a c.l.c. issue. :-) however, a google search for "LFS" "Large file summit", 2GB, etc. will probably lead you to the right answer as well.
Thanks to all who responded. This URL seems to cover the issue fairly well:
http://www.suse.de/~aj/linux_lfs.html
Indeed. With the correct platform-dependant invocations, you can make
Linux C programs generate (or interact with) files over several terabytes.
Again, that's not really the c.l.c. problem domain. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Don |
last post by:
Hi all,
I need to read an uploaded file into chunks, so I can examine the acculative size between chunks to
determine if a maximum size is being exceeded. I'm currently using the PHP function
"move_uploaded_file()" to move it in one piece. But, I'm finding some clients files are bigger than
I want to allow, and with that function I don't have an opportunity to determine that until the
entire file has been uploaded.
Thanks for any...
|
by: steve |
last post by:
I am setting up a huge database in mysql, and I get the above error in
Linux. I believe it is related to the size of one of my tables, which
is 4,294,966,772 bytes in size. Can someone help. How can I break
that barrier.
A google search did not turn up anything useful.
--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
|
by: Jenny |
last post by:
Hi - I've inherited responsibility for our church's website. It has a
sizeable main menu, which uses mouseover image swaps. These images use a
pre-load script but the script is only included in the index.html page. My
javascript knowledge is weak, but it seems to me if a viewer arrives first
at page12.html, he gets no benefit of the preload script. My quandry -
Should I include the preload script on every page, or would this force each
of...
|
by: Tom Kaminski [MVP] |
last post by:
Is there anyway to gracefully catch a file upload limit error? When the
limit is exceeded, IE displays a generic "Cannot find server or DNS error"
message.
--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserver2003/community/centers/iis/
http://mvp.support.microsoft.com/
http://www.iisfaq.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
|
by: tshad |
last post by:
I have an upload file input as:
<input id="MyFile" style="width:300px" type="File" runat="Server">
This works fine, but I find that if my page doesn't pass validation during
postback, the page comes back with all the data intact, except for the
upload object. The text box for "MyFile" (my example) is always cleared.
Why is that and is there a way to stop that from happening?
Thanks,
| |
by: Prabhat |
last post by:
Hi Friends,
I have code that will "BinaryWrite" a EXE file of 20mb to client using the
ADO Stream. After the download the EXE file works fine without any problem.
When I verified the EXE that gets downloaded to client machine that EXE has
the below text added to the bottom:
---------------------------------------------
<font face="Arial" size=2>.<p>Active Server Pages</font> <font face="Arial"
size=2>error 'ASP 0113'</font>.<p>.<font...
|
by: eastcoastguyz |
last post by:
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).
|
by: Jacotheron |
last post by:
I need a PHP script that can upload music files (mp3). The script is for a home project I have started a while ago. I have a MySQL database of all the music that I have. Other computers on the network should be able to connect to the database and run queries on the database or upload new music that does not yet exist on the database. The uploaded file's name should be in the following format: ARTIST - TITLE.mp3. I have the code to upload images,...
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script.
What You Need
Any recent...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |