9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] create() and mtime
@ 2003-10-22 17:46 Fco.J.Ballesteros
  2003-10-22 18:06 ` rob pike, esq.
  0 siblings, 1 reply; 4+ messages in thread
From: Fco.J.Ballesteros @ 2003-10-22 17:46 UTC (permalink / raw)
  To: 9fans

It looks like a create of an existing file is not updating mtime. As a result
news prints old news because the mtime of $home/lib/newstime gets fixed to
the actual creation (not truncation) time.


I changed
create(newstime)

to
remove(newstime)
create(newstime)

in our news program, but that's  probably wrong.

BTW, the file server where newstime lives on in fossil backed up by venti.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] create() and mtime
  2003-10-22 17:46 [9fans] create() and mtime Fco.J.Ballesteros
@ 2003-10-22 18:06 ` rob pike, esq.
  2003-10-22 18:56   ` jmk
  0 siblings, 1 reply; 4+ messages in thread
From: rob pike, esq. @ 2003-10-22 18:06 UTC (permalink / raw)
  To: 9fans

> It looks like a create of an existing file is not updating mtime. As a result
> news prints old news because the mtime of $home/lib/newstime gets fixed to
> the actual creation (not truncation) time.

i just noticed this myself.  you need to write to a file to get its mtime updated.
i believe this is a mistake; the manual says mtime is time of change of content,
not time of write.

i would change your news program to create and write a byte.

-rob



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] create() and mtime
  2003-10-22 18:06 ` rob pike, esq.
@ 2003-10-22 18:56   ` jmk
  2003-10-23 10:38     ` Fco.J.Ballesteros
  0 siblings, 1 reply; 4+ messages in thread
From: jmk @ 2003-10-22 18:56 UTC (permalink / raw)
  To: 9fans

On Wed Oct 22 14:08:39 EDT 2003, r@geekmail.cc wrote:
> > It looks like a create of an existing file is not updating mtime. As a result
> > news prints old news because the mtime of $home/lib/newstime gets fixed to
> > the actual creation (not truncation) time.
>
> i just noticed this myself.  you need to write to a file to get its mtime updated.
> i believe this is a mistake; the manual says mtime is time of change of content,
> not time of write.
>
> i would change your news program to create and write a byte.
>
> -rob

i would fix the bug. new version of /sys/src/cmd/fossil/file.c on sources.

--jim


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] create() and mtime
  2003-10-22 18:56   ` jmk
@ 2003-10-23 10:38     ` Fco.J.Ballesteros
  0 siblings, 0 replies; 4+ messages in thread
From: Fco.J.Ballesteros @ 2003-10-23 10:38 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 139 bytes --]

I was not sure of the correct behaviour, so I couldnt fix it.
For me it was not clear if it was a feature or not.

Thanks for the fix.

[-- Attachment #2: Type: message/rfc822, Size: 2313 bytes --]

From: jmk@plan9.bell-labs.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] create() and mtime
Date: Wed, 22 Oct 2003 14:56:41 -0400
Message-ID: <2457b115760b955da8e1e96de8434eea@plan9.bell-labs.com>

On Wed Oct 22 14:08:39 EDT 2003, r@geekmail.cc wrote:
> > It looks like a create of an existing file is not updating mtime. As a result
> > news prints old news because the mtime of $home/lib/newstime gets fixed to
> > the actual creation (not truncation) time.
>
> i just noticed this myself.  you need to write to a file to get its mtime updated.
> i believe this is a mistake; the manual says mtime is time of change of content,
> not time of write.
>
> i would change your news program to create and write a byte.
>
> -rob

i would fix the bug. new version of /sys/src/cmd/fossil/file.c on sources.

--jim

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-23 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-22 17:46 [9fans] create() and mtime Fco.J.Ballesteros
2003-10-22 18:06 ` rob pike, esq.
2003-10-22 18:56   ` jmk
2003-10-23 10:38     ` Fco.J.Ballesteros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).