Conflict of writing and reading .mat file

2 views (last 30 days)
Yian
Yian on 9 Oct 2015
Answered: Walter Roberson on 10 Oct 2015
My code needs to read a mat file for several times, but the file will be updated by another programs. How to avoid conflict if it is reading when file is updated ?

Answers (1)

Walter Roberson
Walter Roberson on 10 Oct 2015
If you have the cooperation of the other program then this can be fairly simple. If you do not have the cooperation of the other program than this can be difficult and may require enhanced access permissions to the operating system table of open files.
There are mechanisms that are not so bad that can notify you when a file is being changed, but the mechanisms to tell you when all other processes have closed the file are lacking.
The details are going to depend upon the operating system you are using.
If you can get the cooperation of the other program then you are much much better off.

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!