Error using mkdir but not using !mkdir

조회 수: 21 (최근 30일)
Rick
Rick 2020년 7월 27일
답변: Samay Sagar 2024년 9월 24일
I'm running Matlab 2019b on a MacOS Catalina (10.15.5) and I am connected to a University Network drive which is mapped using Samba ('smb://') to
/Volumes/research-data/PRJ-dasa
I'm using a Matlab application (Brainstorm) which must create new directories within this project dir. However, when it tries to do so it results in the following error
>> cd /Volumes/research-data/PRJ-dasa
>> mkdir somepath
Error using mkdir
Read-only file system
However when I try to create the directory using either of the two following lines, the directories are created just fine.
>> !mkdir somepath
>> system('mkdir someotherpath')
So, my question is why does Matlab think the drive is read-only, when the system can create new directories without issue?
Your help is very much appreciated.
Rick
  댓글 수: 2
Zoe Hughes
Zoe Hughes 2022년 8월 10일
편집: Zoe Hughes 2022년 8월 10일
I have the exact same question. I am running 2021b on Monterey 12.4 but have the same issue with the smb server. Any insights, anyone?
sshr
sshr 2024년 2월 9일
Similar issue on mac running R2023b on Sonoma 14.2.1 connected to network drive mapped using smb

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

답변 (1개)

Samay Sagar
Samay Sagar 2024년 9월 24일
The above issue can occur if MATLAB is running with different permissions compared to the terminal. Verify that MATLAB has necessary permissions to modify the network drive.
You can use the following command to check file system permissions for the network drive within MATLAB:
fileattrib /Volumes/research-data/PRJ-dasa
You can try starting MATLAB with "sudo" command to see if this resolves the issue:
sudo matlab
If this doesn't work, you can try mounting the Samba server to the local filesystem hierarchy. Then MATLAB can access and write files in the mounted folder/drive like regular local filesystem files.

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by