touch: got to be owner if use date string
John F Haugh II
jfh at greenber.austin.ibm.com
Wed Feb 13 05:21:52 AEST 1991
In article <DANJ1.91Feb12091029 at cbnewse.ATT.COM> Dan_Jacobson at ATT.COM writes:
>spotted on Amdahl UTS 5.2.6....
>
>$ ls -l lcircle10.300pk
>-rw-rw-rw- 1 dvorak dvorak 4340 Feb 12 07:51 lcircle10.300pk
>$ id
>uid=47941(danj1) gid=47941(danj1) fsid=8(45262)
>$ touch lcircle10.300pk
>#that worked, why not this? works when I'm owner...
>$ touch 1231235999 lcircle10.300pk
>touch: cannot change times on lcircle10.300pk
Not sure which part should be the bug.
In the olden days, touch without an argument read and wrote the
first byte of the file. That was sufficient to change the file
modification time.
Nowadays, touch takes a date and uses the utime(2) system call
to change the last read or written dates. This calls requires
the user to be the file owner or root.
The initial question I raised concerns whether the "old style"
behavior should still work. I think the answer is "why not."
--
John F. Haugh II | I've Been Moved | MaBellNet: (512) 838-4340
SneakerNet: 809/1D064 | AGAIN ! | VNET: LCCB386 at AUSVMQ
BangNet: ..!cs.utexas.edu!ibmchs!auschs!snowball.austin.ibm.com!jfh (e-i-e-i-o)
More information about the Comp.bugs.sys5
mailing list