I've googled this quite a bit and can't find a way to tell if a file is currently being accessed or at least written to. Anyone dealt with this before? If one app if writing to a file another can be reading it before the first is finished writing..
ihatehippies
11
Junior Poster
Recommended Answers
Jump to PostYou could try to test whether the file is open by using f.closed which will return False if the file is open and True if the file is closed, for example:
f = open(somefile, 'r') f.closed
The above will return False but:
…f.close() f.closed
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.