bug-coreutils
[Top][All Lists]
Advanced

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

Re: a bug in "touch"?


From: Bob Proulx
Subject: Re: a bug in "touch"?
Date: Thu, 29 Jan 2004 23:06:01 -0700
User-agent: Mutt/1.3.28i

Steve Magee wrote:
> Sorry about not supplying you with the version of "touch".
> Just assume that with RH v9, the version of touch was known.

Truly I have no idea what RH 9 or almost any other distribution
shipped.  I could download the bits, install it and then check what
version of things they ship.  But that would be a lot of work and take
a lot of time.

http://www.linux.org/dist/list.html is listing 246 linux kernel based
distributions.  That does not count GNU/Hurd or non-x86 GNU/Linux or
Cygwin or from-scratch or commercial systems.  Trying to keep track of
all of them would not be an easy task.  I don't even try.

Of course the GNU Operating System is the focus of the GNU Project.  I
personally am running from-scratch, Debian GNU/Linux, HP-UX and
IBM-AIX.  I know others are running Solaris.  I am sure many people
could pipe in with a long list of platforms, pretty much every type
available on the planet.  I can look on any of the systems I have
access to but that is only a small fraction of the entire user base.

> Your suggestion of using ls -l --time-style=long-iso does work 
> correctly in my script.  By the way, more options for --time-style
> are found in "info" then in "man".  Coming from UNIX, I keep 
> forgetting to use the "info" command.  

Patches, especially for documentation, are always appreciated.  I
looked between the man page and the info page and I could not find any
formats which were missing.  Perhaps I missed seeing one?

In any case the man pages are best as syntax references and not as
good for extensive user guides.  In order to keep them accurate they
are generated from the program output automatically using help2man
using the --help output.  This keeps the program and the man page very
closely in sync with each other.  The info pages are designed to be
more extensive and more of a user guide and may be displayed and
printed in a number of formats.  All of this is a compromise but it
has worked well so far.

> I feel this concern of using the current year should be noted in 
> the manpage of touch. It is noted regarding the date input format 
> in the "info touch".

I am not sure exactly what you are saying.  The date input docs I am
looking at just say that it uses TIME instead of the current time.
Please feel free to make a suggestion for improvements.

In this case I think most people would assume that a date without a
year means the current year.  This is typical.  I can't think of any
programs that don't do that.  So I really don't think it needs too
much said about it.

The 'ls' program is the one that is a little strange.  It decides that
if the file is "old" (defined as six months) then you probably don't
care about the time of day.  But you do care about the year in that
case.  So it switches displaying one instead of the other.  It is
optimizing for screen space and trying to display just the important
stuff.  This creates different output at different times and is
arguably a bad thing.  But this output format has been part of the ls
command forever.  Changing that would cause an upset on users used to
this adaptive format.  However by using options the format can be made
more robust.  And so it is.

> I was already using your method of using a temporary filename
> to make the changes.  The problem was just the small window
> after the turn of the new year.  When I tested this out, it
> was in the middle of the year.  It worked, so I applied the
> method that worked.  6 months after the last update to that file, 
> the time changes to the year of last update.  My old method of 
> touch -d "$mo $day $yrtime" fn, did not change the timestamp that 
> had the year, instead of the time.

Hmm...  You were actually probably changing the timestamp when it was
old but just did not see it.  If the timestamp was more than six
months in the past it would display only to the day.  Touching a file
to the day would set it to midnight on that day.  But if you are not
seeing that in the file listing then you might not even notice.

> Again, thank you very much for your help.  I'll try and 
> refer to "info" more often.  Hate to see the manpage disappear.
> It's part of UNIX like the who command.

By the way, I like having man pages available too.  They are quick and
easy to access.  I also like having --help output available.  I don't
see them going away any time soon.

Bob




reply via email to

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