-
Is there a way that I can open a txt file for use by several instances of the same EXE?
I have Program1.exe that monitors the number of Program2.exe instances that are running. If less than 10 instances, a new one is started. When Program2.exe is finished processing, it Ends.
This runs Program2.EXE 118 times @ 10 concurrent "Connections" at a time.
I would like for all 10 instances to write to a txt (Log) file without fear of a file lock by any of the others.
Can this be done?
Thanks,
Kevin Sutton
VB6 Professional w/SP4
-
Code:
Open "C:\app\log.txt" For Output As #1
Print #1, "text"
Close #1
If you want to write more information to the end of a file:
Open "C:\app\log.txt" For Append As #1
Print #1, "text"
Close #1
-
I do believe that if the file is open for Rando Access then it may re-opened on another channel, without closing the file first.
Code:
ie
Open myFile For Random As #1 Len = Len(myRecord)
Open myFile For Random As #2 Len = Len(myRecord)
etc
DocZaf
{;->