Hi Folks,
I have a small GUI application that writes to a text file. This is basically the part of the script:
$fh = FileOpen("Test.txt", 9) ;Append at the end of the File and create the dir structure if it doesn't exist
FilewriteLine($fh, "Bli bla blubb...") ;Write 1 - many lines to the file
FileClose($fh)
So ... sometimes while that application is running, there is another file that does something like this:
$fh = FileOpen("Test.txt", 2) ;Open file, erase the contents
FileClose($fh)
Okay, so basically that is bad, because it results in the first script writing several "NULL"s to the file, so if I try to read that file with another script and _FileReadToArray() it basically exits with RC 2 (Unable to split the file).
So the question is: Can I detect that the first file is already opened by an application?
Maybe I need to mention that the files is stored on a network drive.
Any comments are welcome.