Jump to content

Multiple Writes to text file


deef99
 Share

Recommended Posts

We have created an AutoIT app that several PCs run on their desktop. When a particular parameter gets met, the app will write to a text file. All that is working well in a single PC environment.

My question is this...all the PCs are writing to the SAME file name across the board. Is this an issue in any way? Are there implications in multiple writes to the same file name [which could happen at same time?

I have the code Opening the file, write and close within a few lines of each other.

Would it be better that each PC write to a unique filename?

Looking for the best idea to avoid problems.

Many thanks!

Link to comment
Share on other sites

I think one method could be when one script has a file open it sets a flag indicating that the file is locked. If another script wants to write to that file while it is locked then it has to wait in a line. But then you run into issues with one user changing a particular line and then another user coming along and changing the same line. WHich change should be accepted? This is what SVN takes care of. My SVN client of choice is Tortoise. Check it out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...