in reply to Persistent data storage
Hello ssinha, and welcome to the Monastery!
You are trying to modify a text file in-place, but are using the wrong method. Consider the following extract from the documentation for open:
You can put a + in front of the > or < to indicate that you want both read and write access to the file; ... You can't usually use either read-write mode for updating textfiles, since they have variable-length records.
Here are some strategies you can use:
Alternatively, depending on your needs, you may be well-advised to pursue the database solution recommended by sundialsvc4 above.
Hope that helps,
Athanasius <°(((>< contra mundum
|
|---|