Is there a way to detect if a file is open in another application from MATLAB?
Show older comments
I have a problem reading a file and I would like to check if the file is already opened by another application before using load.
I have received access conflicts when I try to read a file with MATLAB while this file is written to by another application.
Any idea?
2 Comments
Walter Roberson
on 8 Feb 2011
Are you willing to restrict this question to MS Windows and access to either local drives or a shared drive on a Windows server? The answers get much more complicated in other cases.
quai20
on 8 Feb 2011
Accepted Answer
More Answers (1)
Aurelien Queffurust
on 8 Feb 2011
1 vote
Another strategy is to use a file as a semaphore.
This trick is used for example in this submission: Multicore - Parallel processing on multiple cores
Categories
Find more on File Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!