Jump to content

force FileOpen possible?


Recommended Posts

Hi I have following Problem. I need to write some text into a file that is opened by an other process.

If I try to write into the file like this:

$file = FileOpen("test.txt", 1)

; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

FileWrite($file, "Line1")
FileWrite($file, "Still Line1" & @CRLF)
FileWrite($file, "Line2")

FileClose($file)

I get error Unable to open file.

If I use iniwrite for same file i can write into the file.

How can i force FileOpen now to open it for write into the file even if other process is writing to it?

Or is their a way to unlock the other file with autoit?

I hope someone here can help me :mellow:

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...