file open verification

Charles W. Strickland cstrickland at surry.net
Tue Oct 1 00:19:56 EDT 2002


On 27 Sep 2002 19:30:38 +0200, Chris Liechti <cliechti at gmx.net> wrote:

>python473 at yahoo.com (John Howard) wrote in 
>news:9eabe547.0209270710.17ca112d at posting.google.com:
>
>> Two questions - somewhat related:
>> 
>> Situation - I have several files on an apache server that are being
>> accessed by
>> python programs that are receiving data from html forms.
>> 
>> q1: How can the status of a file be checked?  If two forms have been
>> submitted
>> and the data is being added to a common file, how do I know that data
>> from both forms are being written correctly to the common file?
>
>don't ever write simultaneous from two processes to one file. your choices 
>are:
>- use "locks", so that only writes at a time
>- one server writes the file, logs are directed to that server (like syslog  
>on linux)

Not sure what you mean here.  Are you saying that if a server file is
used, then it is not a problem?  Is that related to his apache
question?  Does the apache server handle locks?
 
>all these options ensure that one writes after the other. avoiding problems 
>is better than fixing.
>
>> q2: Related to above - really more of a cgi question - does the apache
>> server keep all these file accesses separate some way?
>
>don't know apache. if you manage to limit it on one thread, only one can 
>access the file. but iin that case the performace of the server is poooooor 
>;-)
>
>chris
>-- 
>Chris <cliechti at gmx.net>
>




More information about the Python-list mailing list