nate <mailto:[EMAIL PROTECTED]> wrote on Thursday, 30 January 2003 18:46:
> Dan Bar Dov said: >> If the file is owned by the user, touch will modify its >> last-mod-time. This is contrary to my understanding that a read only >> file cannot be modified (unless I insist as in rm -f) >> >> Is this standard on all Unixes? > > [snip]... > I am not sure if this is standard, but you shouldn't rely on this > sort of test with touch. I don't feel like powering up my solaris > machines but my FreeBSD 4.7 system shows the same behavior. My > RS/6000 and SGI Indy aren't plugged in either. > > nate Same on Solaris. If you think about it, the times are in the inode, not the file. Blocking write permissions to a file cannot also block write permission to the inode, because that is where the permissions are stored - but you don't have general access to the inodes anyway. Whether the file is actually writable or not, touch is still just lying about it being modified. It does not actually modify it. I then started trying to remember how touch works - the system call it uses is utime(2), so you can read the man page on the defined permissions for modification. I tried on the Solaris man page but it left me too confused to repeat here. I think they meant it is ok if you are effectively root, or the owner, or have write permission. Different permissions might apply if you are trying to set another time in the past or the future. I presume there's a Posix standard for it. Somewhere. Cameron. -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list