By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,689 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,689 IT Pros & Developers. It's quick & easy.

File is used by another program how to find this using python?

P: 16

In a folder there are 10 files, in that 3 files are in used by another process i want to pick only the files which was in not in use....

If the Python script is available kindly share with me...

Thanks in Advance,

Oct 31 '12 #1

✓ answered by bvdet

There is no way to do this on Windows that I am aware of. I've looked!

Share this Question
Share on Google+
3 Replies

Expert 100+
P: 626
Take a look at the manpage for lsof (list open files). You would have to parse the output to find the directory and file name(s).
Oct 31 '12 #2

P: 16
i am not getting the result exactly with Isof i am using the windows 7 and python 2.7 version...
Using Isof i can get the CPU utilities but i required the current status of a file, whether the file is opened by another process or not...
If i have a folder in that 10 text files are there and 5 files are currently opened by another application and using the files i want the total file names and also the files which are current in use...
Thanks for your response...

Nov 1 '12 #3

Expert Mod 2.5K+
P: 2,851
There is no way to do this on Windows that I am aware of. I've looked!
Nov 1 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.