Multiple Simultaneous open .csv file operations

I am trying to write to multiple csv files simultaneously while having them read as they are updated by another instance of MATLAB. I can do this with one file at a time or with sequential updateing, but my aim so to update them in unison. The purpose of this is to emulate a system feeding streaming data into my script via multiple csv files. I have tried to write them useing a parfor loop which does do simultaneous writing but locks the files so they are inaccessable to the second instance. Does MATLAB support this kind of functionality and if so what methods are used to achieve it?

댓글 수: 2

Are you able to read a csv file while it is being updated by another instance of MATLAB?
I am but I'm trying to avoid file IO.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 9월 17일

0 개 추천

which does do simultaneous writing but locks the files so they are inaccessable to the second instance
That tells us that you are using MS Windows. The locking is coming from MS Windows, and it is automatic, and the locks are mandatory locks unless the process doing the I/O operation specifically asks that the file not be locked.
MATLAB does not in itself offer any operations to turn off file locking.

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

질문:

2020년 9월 11일

답변:

2020년 9월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by