Jump to content

Trouble with INI read with two exes


Recommended Posts

Aloha gang

I've run into trouble trying to get two exe's one

starts the other so they are not sharing the same ini

The second exe is not able to read the first ini

Someone try that

Have one exe right to an ini say a path

then have the first one run or runwait the next exe

then have the next exe try to read the same ini

It's been suggested that I make sure the ini is closed before th next exe takes over, but even using autoitx and running the two exes consecutively without a run command starting one from the other does not seem to solve the problem.

Any advise or is there another way I can transfer the info I need such as path, title info etc

Rick

Link to comment
Share on other sites

When EXE_1 calls EXE_2, are you passing the INI file as a parameter?

Could you perhaps eliminate the INI file altogether by passing the info you want to transfer between EXE_1 and EXE_2 as a $CmdLine to EXE_2?

Can you "trivialise" your code, by writing 2 EXEs that do nothing else but try and communicate as you wish? If so, then can you post it as an illustration of what you are trying to do, and as a starting point for others to help you?

Link to comment
Share on other sites

If a file write lock is held on the file, any other application will not be able to access the file. I ran into this problem on my FTP server when I got disconnected while uploading a file. For some reason the server doesn't kick me right away, but the file lock is maintained. That means I can't append data to it, or even downloadload it because it is in use by that application.

The upshot of this is that you can't have the 2nd program read the script until the first closes the file and unlocks the file.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

If a file write lock is held on the file, any other application will not be able to access the file.  I ran into this problem on my FTP server when I got disconnected while uploading a file.  For some reason the server doesn't kick me right away, but the file lock is maintained.  That means I can't append data to it, or even downloadload it because it is in use by that application.

The upshot of this is that you can't have the 2nd program read the script until the first closes the file and unlocks the file.

So how do I get it to close the file?

The command thingie is a good idea though part of my script has autoitx for the menu.

I'm still confused about command params can someone give me an example. I look at it in the help file and it doesn't, well, help me

Thanks

Rick

Link to comment
Share on other sites

When you call a FileOpen command in modes 1 or 2 the file is opened for writing, and I believe that means no other app can write to it or view it. Just call FileClose($file) to release the lock on the file.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

When you call a FileOpen command in modes 1 or 2 the file is opened for writing, and I believe that means no other app can write to it or view it.  Just call FileClose($file) to release the lock on the file.

But you don't call a fileopen command for an ini

Rick

Link to comment
Share on other sites

But you don't call a fileopen command for an ini

Pfft, shows you how well I read the topics. :ph34r: Well, I believe AutoIt makes a complete fileopen, write, and fileclose when you do an iniwrite. My only suggestion at this point is to give it a short pause between writing the ini and launching your 2nd script that needs to access it. If I'm wrong about the fileClose call durring an ini write, it would be nice to know that too.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Pfft, shows you how well I read the topics. :ph34r: Well, I believe AutoIt makes a complete fileopen, write, and fileclose when you do an iniwrite. My only suggestion at this point is to give it a short pause between writing the ini and launching your 2nd script that needs to access it. If I'm wrong about the fileClose call durring an ini write, it would be nice to know that too. Presently I'm exiting the program and using a autoitx menu to run the next program I'll place a 0autoit3.sleep 3000 command in there

I'm also using a vb script to change the title of my menu so I can read the window title in case the ini fails

Thanks

Rick

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