Open file handles?

T

Thomas Bartkus

This may be more of a Linux question, but I'm doing this from Python. .....

How can I know if anything (I don't care who or what!) is in the middle of
using a particular file?

This comes in context of needing to copy a file BUT only if I can verify
that something else doesn't have an open write handle to that file. IOW - I
need to decline the operation if something else hasn't finished writing to
the file.

How can I know?
Thomas Bartkus
 
D

danielx

Is there an equivalent in windows?
Perhaps using os you could work with lsof
[http://www.linuxcommand.org/man_pages/lsof8.html]

Jon

Thomas said:
This may be more of a Linux question, but I'm doing this from Python. .....

How can I know if anything (I don't care who or what!) is in the middle of
using a particular file?

This comes in context of needing to copy a file BUT only if I can verify
that something else doesn't have an open write handle to that file. IOW - I
need to decline the operation if something else hasn't finished writing to
the file.

How can I know?
Thomas Bartkus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top