Jump to content

Recommended Posts

Posted

Is it possible to have more than one PC using IniRead() and IniWrite() to the same file on a network share without getting errors?

Posted

Is it possible to have more than one PC using IniRead() and IniWrite() to the same file on a network share without getting errors?

<{POST_SNAPBACK}>

According to my two-computer dry run, yes and no. IniRead() works fine--there's just a slight delay if the file is in use. IniWrite(), however, may append excess garbage to the end of the file in the form of lines with a Y and nothing else on them. This may be only if the file is being written to by multiple computers, but it's likely that if it's tied up by an IniRead() operation you'll get the same results.

In my test, each computer wrote to the same value on an infinite while loop. Using notepad2 and refreshing the file, I saw that the value varied by which computer had written to it last. No errors from the scripts, but there was a growing list of lines with just a Y on them (not from refreshing notepad2, either). Probably meant as an overwrite or similar response to the file being locked.

Reading is easier. While both computers were running that script, I had one of them run a second script to read the variable and put it in a splash text. Sometimes there were big delays between flickers (meaning despite an infinite loop with no sleeping, IniRead caused a delay waiting for the file to be availible--one delay looked to be more than a few seconds long).

Running two read scripts and no write scripts, each computer's splash text flickered rapidly. There was still a wait on one while the file was in use in the other, but the process was much faster.

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
  • Recently Browsing   0 members

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