Jump to content
Sign in to follow this  

file in use

Recommended Posts

while 1
$file = FileOpen("1.txt", 0)
While 1
$line = FileReadLine($file,$a)
If @error = -1 Then ExitLoop
;using this section as a way to escape from reading
$result = StringInStr($line, "Compressor:",1)
if $result = 5 then call("teminate")
func teminate()

i am using the above code to read a text file that is being used and constantly being updated. the stringinstr is what i am using to exit from reading when it has reached the end of the updated file. this is real time showing of the file. that is why it loops.

i am suspecting that it can be rewritten with fileopen in write mode with an error check, but for me doing that myself has illuded me because i am sleepy.




Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...