bourny Posted July 13, 2009 Share Posted July 13, 2009 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 13, 2009 Moderators Share Posted July 13, 2009 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. Link to comment Share on other sites More sharing options...
bourny Posted July 13, 2009 Author Share Posted July 13, 2009 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 Link to comment Share on other sites More sharing options...
Bert Posted July 13, 2009 Share Posted July 13, 2009 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 fileYou could add a sleep() so that if it sees it, the sleep will go first then kick off the file. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
99ojo Posted July 13, 2009 Share Posted July 13, 2009 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now