Line replace

Paul Rubin http
Sun Jan 1 15:02:23 CET 2006


DarkBlue <nomail at nixmail.com> 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, 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 primitives to make sure other processes don't update
the file simultaneously.



More information about the Python-list mailing list