Thank you for all the suggestions
It appears the safest solution still is using a temp file
as was so apt suggested further up here without it I maybe
white water rafting without a canoe.
I also will test the feasibility to regenerate
the whole file from the database.
Nx
--
http://mail.python
DarkBlue <[EMAIL PROTECTED]> writes:
> pseudocode is like this:
>
> get newlinetext from database # this is ok done with kinterbas
> preferably check if file not in use by other process
> open file and find desired marker
> go to line after marker and replace that one with newlinetext
> close the
> OK, why don't you store those changing lines in the database?
>
> Can you arrange for those changeable lines to be fixed length, i.e.
> by padding with spaces or something? If you can, then you could just
> overwrite them in place. Use flock or fcntl (Un*x) or the comparable
> Windows locking
DarkBlue <[EMAIL PROTECTED]> writes:
> The markers are just there to have a static way to find the line
> after the marker, which is the one which might have to be changed.
OK, why don't you store those changing lines in the database?
Can you arrange for those changeable lines to be fixed length,
> Why don't you use the database to store those markers? It should
> support concurrent updates properly. That's a database's job.
The markers are just there to have a static way to find the line
after the marker, which is the one which might have to be changed.
Nx
--
http://mail.python.org/m
DarkBlue <[EMAIL PROTECTED]> writes:
> Now our authorized clients register themselves automatically with
> computername,id and ip address via a small python script which sends this
> information to a firebird database on our server...
> Every client has a marker in the hosts.allow file
> so if a ch
Steven D'Aprano wrote:
> Let me see if I understand your problem... you need to edit a text file
> in place at the same time that another process is also changing the file
> in place? That's hard. You need some way to decide who gets precedence if
> both you and the other process both try to cha
>Hello
>
> I need some help
>
> I have a text file which changes dynamically and has
> 200-1800 lines. I need to replace a line , this line
> can be located via a text marker like :
>
> somelines
> # THIS IS MY MARKER
> This is the line to be replaced
> somemorelines
>
> My question is how
On Sun, 01 Jan 2006 19:31:38 +0800, DarkBlue wrote:
> Hello
>
> I need some help
>
> I have a text file which changes dynamically and has
> 200-1800 lines. I need to replace a line , this line
> can be located via a text marker like :
>
> somelines
> # THIS IS MY MARKER
> This is
Hello
I need some help
I have a text file which changes dynamically and has
200-1800 lines. I need to replace a line , this line
can be located via a text marker like :
somelines
# THIS IS MY MARKER
This is the line to be replaced
somemorelines
My question is how to do this
10 matches
Mail list logo