Jump to content
Sign in to follow this  
bourny

File Lock

Recommended Posts

bourny

Is there a way to test if another application has a lock on a file ... I can do a fileMove to test this but I have noticed when I do this using FileMove the CPU usage during this process spikes at 90%+ if the file is locked ....

I am using this FileMove in an adlib that sleeps every second and rechecks this to keep the CPU load from ataying at 90%+ However I would like to remove the cpuload so I can speed up the script.

Any ideas how to test the file has a lock without trying to move the file to determine this ..

Many Thanks

Share this post


Link to post
Share on other sites
SmOke_N

FileOpen() in read mode doesn't work for you?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
bourny

I dont want to open the file as it is an executable -

Here is a more detailed description of what I am doing

- .exe File lands on a client but when it lands the server pushing it does not release it stright away

- My script is looking for the exe landing once there it will try to execute it

- My script fails to execute it as the server pushing the file still has a lock on it.

- I am therefore using file move to determine when the lock has completed so I can launch the file

Share this post


Link to post
Share on other sites
Bert

I dont want to open the file as it is an executable -

Here is a more detailed description of what I am doing

- .exe File lands on a client but when it lands the server pushing it does not release it stright away

- My script is looking for the exe landing once there it will try to execute it

- My script fails to execute it as the server pushing the file still has a lock on it.

- I am therefore using file move to determine when the lock has completed so I can launch the file

You could add a sleep() so that if it sees it, the sleep will go first then kick off the file.

Share this post


Link to post
Share on other sites
99ojo

You could add a sleep() so that if it sees it, the sleep will go first then kick off the file.

Hi,

maybe a combination of _Net_Share_FileEnum and _Net_Share_FileGetInfo gives you a clou.

;-))

Stefan

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.