I am looking for a simple already implemented solution for atomically creating a file lock in MATLAB.
Something like:
file_lock(\'create\', \'mylockf
Write to a new file, then rename it. Renaming is an atomic operation, and all the new content will become visible at once.