Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing to specific line

Status
Not open for further replies.

saltbits

Programmer
Jun 1, 2004
27
US
I have 4 batch processes that begin to run at the same time. They all read from and write to a properties file. So the properties file looks like this (with the values changing everyday, of course):
Batch1Date=20040809
Batch2Date=20040729
Batch3Date=20040808
Batch4Date=20040808

These wont have to be in this same order. But my question is, if more than one batch process tries to write to this properties file at the same time, will there be problems? I just need to make sure no writing is lost or no previous value is retained because of concurrent access and unavailability of the file for writing by a batch process.

I cant run batch for the timebeing and so I cant test this myself. Thanks for any help.
 
If these batch process' do not lock the file when writing, then if they happen to update at the same time, you may end up with a corrupt file.

Maybe better to create separate file for each batch process.


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Thanks LKB. I guess I will just have separate files for each.
 
Remember to execute a 'sync' after writing.


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Thanks. I never knew of such a command and just now read it up after seeing your response(am a long-time newbie). Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top