Cannot write to file: permission denied

5 Ansichten (letzte 30 Tage)
naomi rosen
naomi rosen am 24 Feb. 2020
Bearbeitet: naomi rosen am 27 Feb. 2020
I am using Matlab on a Linux machine. I have set the default startup dir as a dir to which i have write permissions. When I run [gid, errmsg] = fopen(fname,'w'); (where fname is just the filename I want written to the current dir--no path), I get gid = -1 and errmsg = permission denied. I'm running Matlab using an icon. Could I be the wrong user? Any other suggestions? Thanks.
Edit: after two days of internet problems, computer is back online (I think the Network Manager settings were changed, but it took the IT people a long time to find and fix) and the problem seems to have disappeared. thanks, everyone.
  2 Kommentare
Pujitha Narra
Pujitha Narra am 27 Feb. 2020
Hi,
You can try changing the permissions to the folder using the following command on the terminal:
chmod -R 0777 foldername/
or
Try launching MATLAB with sudo.
Walter Roberson
Walter Roberson am 27 Feb. 2020
What shows up for
!whoami; ls -ld .
The period is part of the command.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by