bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: touch --inside: new option for gzipped files


From: Jim Meyering
Subject: Re: touch --inside: new option for gzipped files
Date: Tue, 03 Jun 2003 10:18:30 +0200

Bruno Haible <address@hidden> wrote:
> "touch --inside" is a best-effort operation, which will not work on
...

My point was that if touch actually fails to update a timestamp,
it must give a diagnostic.  With your patch, using --inside
suppresses the failure and diagnostic in some cases.  E.g.,

  $ : > x
  $ sudo chown root x
  $ ./touch --inside x
  $ ./touch x
  ./touch: cannot touch `x': Permission denied
  [Exit 1]

>> And wouldn't it be better also to use O_NONBLOCK | O_NOCTTY, as
>> for the other open call?
>
> Maybe. One has to test whether "touch --inside /dev/tty" hangs or not.
> I can agree to it as long as you are sure that O_NONBLOCK, applied to
> regular files, has no effect (I'm not sure POSIX guarantees this).

Maybe??
Isn't the fact that the existing implementation has been using
those options for years without trouble enough of a guarantee?
Both were added in response to problem reports.
Getting the conceptually simple touch `right' has been surprisingly
tricky over the years.  Any deviation from the current practice must
be very well justified, not the other way around.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]