LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2010, 07:35 AM   #1
Lobinho
Member
 
Registered: May 2010
Distribution: Ubuntu
Posts: 72

Rep: Reputation: 18
CGI program + c++ + download file bigger than ram


Hi,

I have a cgi program (written in c++), which is responsible for the management of some activities on my server (write info into a database, write logs). My problem starts when my client need to download a log file (created by reading database information) from the server, cause the file could be bigger than my ram and I can't split the file. I'm quite new to cgi programs, so I don't know another option.
I didn't find something related on google... anyone knows any link or tutorial to help-me?

Thanks in advance!
 
Old 08-23-2010, 08:59 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

What web server and what client are you using?
Try with wget to download the file and see if it works

Regarsd
 
Old 08-24-2010, 07:40 PM   #3
Lobinho
Member
 
Registered: May 2010
Distribution: Ubuntu
Posts: 72

Original Poster
Rep: Reputation: 18
Dear bathory,

Thanks for your response. I'm using BOA server (http://www.boa.org/) on an embedded environment.
I think wget won't work cause I'll build this file dynamically (read several information from several tables from database) and put everything in a biiiiig txt file.

Anyone knows how a rapidshare/megaupload works? xD
How they send those big files to our machine?
I need something like this... my file will be larger than my ram, so I can't cache the entire file before start to flush it on screen...

regards
 
Old 08-25-2010, 10:18 AM   #4
Hidden Windshield
Member
 
Registered: Jul 2010
Distribution: Fedora
Posts: 68

Rep: Reputation: 27
BOA, like most webservers, takes whatever you send to standard out (cout in the case of C++), and sends it to the client. So, all you need to do is send your log file to cout as it's being generated (after the headers).

As far as the client side program is concerned, it doesn't care (and doesn't even know) if the file is being generated on the fly or is static. So wget, Firefox, Opera, even IE would work to actually download the file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using wget to download a cgi file i.you Linux - Newbie 1 03-29-2008 10:37 AM
/proc/kcore file is getting bigger and bigger. thewhitelion Ubuntu 2 03-07-2008 09:50 AM
Perl/CGI uploader program - temp file not getting deleted anroy Programming 4 09-13-2006 02:33 AM
how to download a EXE file on ram & execute it sapna pandey Linux - General 1 08-30-2006 12:10 AM
does more RAM need a bigger HD? newbiesforever General 30 07-26-2006 09:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration