I have a .csv file with one line that is constantly being overwritten with the most updated data from some data bus. It looks something like this:
Doors
Closed, Open, Closed, Closed,
And it's being updated (lets say every second) so that as soon as a valve changes it will show in the csv file, like so:
Doors
Closed, Closed, Closed, Closed,
If I have a vbscript that is currently reading the line of information will I receive errors by trying to access said file? Here's pretty much the code I have for this part:
'Create the file system object
Set fso = CreateObject("Scripting.FileSystemObject")
'Initialize a few items
strSource = "C:\Test.csv"
'Open the source file to read it
Set inputFile = fso.OpenTextFile(strSource,ForReading)
'Skip the first line since it is the heading
strLine = inputFile.ReadLine
'Read the file line by line
Do while not inputFile.AtEndOfStream
strLine = inputFile.ReadLine
'Split the line on the comma into an array
strValues = Split(strLine, ",")
The code works for .csv files that aren't currently in use but I was wondering if this will throw errors (even though i'm simply reading it) if the file I am accessing is constantly being updated.
Thanks