The server dir is mounted with a user, who definitely has "Write Attributes" permissions in Windows.
/etc/fstab:
//server/shared /mnt/fs1 cifs noperm,rw,nounix,iocharset=utf8,gid=java,file_mode=0774,dir_mode=0775,credentials=/localhome/securedir/fs1.credentials 0 0
The mounted files are directories are readable and writeable.
Changing timestamp of a file works:
> touch -t 01010101 /mnt/fs1/test.file
Changing timestamp of a directory results into "Permission denied":
> touch -t 01010101 /mnt/fs1/baselines
touch: setting times of `/mnt/fs1/baselines': Permission denied
Are there any other mounting options I have to apply? Thanks!
The most reasonable answer I got so far is that Windows does not have modification date attribute for directories. There is only a creation date.
This issue can be really confusing when trying to change the directory's modification date with e.g. java.io.File#setLastModified method. Both under Linux and Windows this API works on local directories with predictable result. However, in one particular constellation, which is trying to set modification date of a mounted CIFS directory on a Linux machine, this API fails to change the date and returns false.