I'm running a shared Samba folder (using a FreeNAS 9.3 box) for shared access to some experiment data. Unfortunately, Matlab seems to have big issues writing files on this share. The share is configured with the options
force create mode=0666
force directory mode = 0777
so that all files can be read or written by anyone. Now when I try to save a Matlab .MAT file it fails like so:
>> a = 5
a =
5
>> save test
Error using save
Unable to write to MAT-file /mnt/share/signals/test.mat
File may be corrupt.
>> save test
Error using save
Unable to write file test: permission denied.
It should be noted that after the first save, a file names 'test.mat' appears in the shared folder which is empty:
$ ls -la test.mat
-rw-rw-rw- 1 nobody root 0 Oct 5 15:42 test.mat
As you can see even the permissions are correctly set to read/write for everyone so it is quite unclear to me whether this happens. Even more strangely, I can do the following:
>> f = fopen('test.mat', 'w');
>> fwrite(f, 'test123456');
>> fclose(f);
>> exit
$ cat test.mat
test123456
So apparently, the problem is not really permission denied or a corrupted file since, apparently, Matlab can write files just fine. So I'm wondering if anyone ever had this problem and has an idea on what the true cause is (or even how to find out) and how to fix this issue.