On Thu 30 Apr 2020 at 12:46:26 (-0400), Alberto Sentieri wrote: > Apparently there is something wrong with the debian stretch utimensat > system call, or with its interaction with cifs. It works as expected > when the destination file is on a ext4 file system, but it does not > work when the destination file is on a SMB file system. > > I wrote a simple C program, which I compiled with <gcc -g -o x2 x2.c>. > > On my debian buster workstation, I run the program using a script, which is: > > #!/bin/bash > NAME='/mnt/u1/rw/receipt/test2.txt' > rm -f "${NAME}" > ls -ls "${NAME}" > /mnt/1g/home/u1/data/cp-pi/x2 "${NAME}" > ls -ls "${NAME}" > sleep 1 > ls -ls "${NAME}" > > Note that the /mnt/u1/rw/receipt is a SMB folder. I got this result: > > $ ./do2.sh > ls: cannot access '/mnt/u1/rw/receipt/test2.txt': No such file or directory > 0 -rwxr-xr-x 1 u1 u1 10 Feb 5 2017 /mnt/u1/rw/receipt/test2.txt > 1024 -rwxr-xr-x 1 u1 u1 10 Apr 30 12:20 /mnt/u1/rw/receipt/test2.txt > > As you can see, the time stamp changes after one second.
Perhaps it's more important that the time changes after the filesystem has allocated some space for it. (Repeat: I'm not familiar with cifs/smb protocols and filesystems.) Cheers, David.