473,382 Members | 1,421 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,382 software developers and data experts.

Writing files on server through CGI

I have a CGI script on server which process a form and writes its
content on a file like
fp = open(fname, 'w')
fp.write('<HTML><HEAD><TITLE>Cool
list</TITLE></HEAD><BODY><H2><CENTER>%s</CENTER></H2><BR><H3><center>%s</center></h3></body></html>

Its working fine, but will it work if the script recieves thousands of
request simultaneously.
Can this script writes files simultaneusly or will all the request
queued and processed one by one. If that is the case then how can I
make this script work so that it can process several requests at a
time.

Thanks
Amaltas

Apr 9 '06 #1
2 1442
On Sun, Apr 09, 2006 at 12:35:21AM -0700, am******@gmail.com wrote:
I have a CGI script on server which process a form and writes its
content on a file like
fp = open(fname, 'w')
fp.write('<HTML><HEAD><TITLE>Cool
list</TITLE></HEAD><BODY><H2><CENTER>%s</CENTER></H2><BR><H3><center>%s</center></h3></body></html>

Its working fine, but will it work if the script recieves thousands of
request simultaneously.
I assume that's a question. No, it won't. If you open a file for writing no
other program can write to it.
Can this script writes files simultaneusly or will all the request
queued and processed one by one.


Sorry, no. What is your intent? Usually you either have CGIs that output
HTML directly or scripts that update an HTML file. But CGIs that write to a
HTML file... that looks pretty uncommon.

Don't worry about updating a static HTML file though. If you are using
a decent web server like Apache it will have the file cached and try to
read it once you are done changing it. But don't use CGIs for that.

Christoph
--
~
~
".signature" [Modified] 1 line --100%-- 1,48 All
Apr 9 '06 #2
this cgi script write different files, request 1 will write 1.html, 2
will write 2.html and so on.
Its not updating the current file.
For example create.py processes a form and write user.html file and
every user is unique.
so if 10 users fill up the form at the same time and click submit
button, can create.py file write 10 html file simultaneously or will
all the request be queued and executed one by one, because at any given
point there can be several users creating this html page.

Apr 10 '06 #3

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

Similar topics

5
by: SomeDude | last post by:
Hi, I have a question on file writing. I am not very experienced in Java programming. My hobby right now is to write an applet where 2 persons could play Go together (it is a board game). The...
48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
10
by: Neil Trigger | last post by:
Is there a way of creating a seperate text file on a server every time a form is sent? -- ¿ Trigger ? http://www.magic2k.com/ http://www.oddmap.co.uk
7
by: Dennis C. Drumm | last post by:
I would like to be able to update an xml file located on my hosted server from my local computer. The server requires a user name and password to access the web site for writing or updating...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
6
by: darrel | last post by:
I'm struggling with an odd permissions problem I have with one of my functions. It takes a file, writes a directory, and then uploads some files to it. This works. Once. Any subsequent attempt and...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
7
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
4
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.