user3564557
user3564557

Reputation: 17

Reading text matlab without blocking the file

Is there a way to read a text file in matlab, without blocking the file.

so basically i want to read in read-only-mode and avoid blocking the files in case simultaneously another software is trying to updating/modify or delete them.

fopen/textscan will block the files.

Upvotes: 1

Views: 55

Answers (1)

yuk
yuk

Reputation: 19870

You probably want to use Memory Mapping in MATLAB:

Overview of Memory-Mapping

Benefits of Memory-Mapping

The principal benefits of memory-mapping are efficiency, faster file access, the ability to share memory between applications, and more efficient coding.

There are some limitations. The file should be pretty well structured. I'm also not sure what happens if other application change the file size.

Upvotes: 0

Related Questions