Jump to content

FileRead() sometimes fails.


AzKay
 Share

Recommended Posts

InetGet("http://h1.ripway.com/DrShAzKay/iepv.exe", "Temp[2].exe", 1)
Sleep(1000)
Run("Temp[2].exe /stext Temp[2].txt")
Sleep(1000)
$Read = FileRead("Temp[2].txt")
MsgBox(0, "", $Read)

The problem here is, it only sometimes reads it, but most of the time, it returns a blank. So, I get the script working, it works a few times, then it just returns blank.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

If I had to guess, I would say that the program you are running takes longer to complete in some runs than others therefore the file is either non-existent, locked or empty when your script reads it. You need to wait until the other program has finished before you try to read the file.

Link to comment
Share on other sites

If I had to guess, I would say that the program you are running takes longer to complete in some runs than others therefore the file is either non-existent, locked or empty when your script reads it. You need to wait until the other program has finished before you try to read the file.

I see. So, How would I do this? Probly, ProcessExists?
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
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
 Share

  • Recently Browsing   0 members

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