public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* utime Bug?
@ 2001-11-11  8:26 chad fowler
  2001-11-11  8:26 ` egor duda
  2001-11-11  8:26 ` Corinna Vinschen
  0 siblings, 2 replies; 5+ messages in thread
From: chad fowler @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin

I'm a new cygwin user and a fairly lame C programmer. 
However, I think I've discovered a bug.  When I find
things like this, I usually assume it's my fault. 
But, this seems to be at least inconsistent with other
platforms.

When you use utime to set the actime to 0 (the epoch),
stat will show actime as being whatever modtime is set
to for that file.  If you set it to anything else (1,
for example), actime is reflected accurately by stat.

Am I off base?  The same code on my Debian box returns
the epoc for atime (instead of the modtime value).

Does this make sense?

Thanks in advance,
Chad

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: utime Bug?
  2001-11-11  8:26 ` egor duda
@ 2001-11-11  8:26   ` chad fowler
  2001-11-11  8:26     ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: chad fowler @ 2001-11-11  8:26 UTC (permalink / raw)
  To: egor duda

> cf> When you use utime to set the actime to 0 (the
> epoch),
> cf> stat will show actime as being whatever modtime
> is set
> cf> to for that file.  If you set it to anything
> else (1,
> cf> for example), actime is reflected accurately by
> stat.
> 
> cf> Am I off base?  The same code on my Debian box
> returns
> cf> the epoc for atime (instead of the modtime
> value).
> 
> you should provide some details. a small testcase
> demonstrating a
> problem is highly desirable. see
> http://cygwin.com/cygwin/bugs.html
> for bug-reporting buidelines.
> 

Hi, thanks for the response.  I apologize for not
supplying a test case.  Here's a modification of your
example program that demonstrates what I mean:


#include <utime.h>
#include <sys/stat.h>
#include <sys/types.h>
int main()
{
  struct utimbuf s;
  struct utimbuf s2;
  struct stat info;
  s.actime = 0;
  s.modtime = 1;
  utime ("./x", &s);
  stat("./x",&info);
  printf("  utime.file access time is %ld\n",
info.st_atime);  // prints "1".  I would expect "0".
  s.actime = 3;
  s.modtime = 1;
  utime ("./x", &s);
  stat("./x",&info);
  printf("  utime.file access time is %ld\n",
info.st_atime); // prints "3", which is both expected
and inconsistent with the one above.
}

I'm on cygwin-1.3.5 and Windows2000

Thanks,
Chad

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: utime Bug?
  2001-11-11  8:26   ` chad fowler
@ 2001-11-11  8:26     ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin

On Wed, Nov 14, 2001 at 12:30:38PM -0800, chad fowler wrote:
> #include <utime.h>
> #include <sys/stat.h>
> #include <sys/types.h>
> int main()
> {
>   struct utimbuf s;
>   struct utimbuf s2;
>   struct stat info;
>   s.actime = 0;
>   s.modtime = 1;
>   utime ("./x", &s);
>   stat("./x",&info);
>   printf("  utime.file access time is %ld\n",
> info.st_atime);  // prints "1".  I would expect "0".
>   s.actime = 3;
>   s.modtime = 1;
>   utime ("./x", &s);
>   stat("./x",&info);
>   printf("  utime.file access time is %ld\n",
> info.st_atime); // prints "3", which is both expected
> and inconsistent with the one above.
> }

Thanks for that nice testcase.  I could easily track it down and
that problem is fixed in the Cygwin CVS repository in a few minutes.

Thanks again,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: utime Bug?
  2001-11-11  8:26 utime Bug? chad fowler
@ 2001-11-11  8:26 ` egor duda
  2001-11-11  8:26   ` chad fowler
  2001-11-11  8:26 ` Corinna Vinschen
  1 sibling, 1 reply; 5+ messages in thread
From: egor duda @ 2001-11-11  8:26 UTC (permalink / raw)
  To: chad fowler; +Cc: cygwin

Hi!

Wednesday, 14 November, 2001 chad fowler chadfowler@yahoo.com wrote:

cf> When you use utime to set the actime to 0 (the epoch),
cf> stat will show actime as being whatever modtime is set
cf> to for that file.  If you set it to anything else (1,
cf> for example), actime is reflected accurately by stat.

cf> Am I off base?  The same code on my Debian box returns
cf> the epoc for atime (instead of the modtime value).

you should provide some details. a small testcase demonstrating a
problem is highly desirable. see http://cygwin.com/cygwin/bugs.html
for bug-reporting buidelines.

fwiw, this snippet:

#include <utime.h>
int main()
{
  struct utimbuf s;
  s.actime = s.modtime = 0;
  return (utime ("./x", &s));
}

correctly sets access and modification times for file './x' with
cygwin-1.3.5 on windows nt 4.0

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: utime Bug?
  2001-11-11  8:26 utime Bug? chad fowler
  2001-11-11  8:26 ` egor duda
@ 2001-11-11  8:26 ` Corinna Vinschen
  1 sibling, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin

On Wed, Nov 14, 2001 at 11:43:37AM -0800, chad fowler wrote:
> I'm a new cygwin user and a fairly lame C programmer. 
> However, I think I've discovered a bug.  When I find
> things like this, I usually assume it's my fault. 
> But, this seems to be at least inconsistent with other
> platforms.
> 
> When you use utime to set the actime to 0 (the epoch),
> stat will show actime as being whatever modtime is set
> to for that file.  If you set it to anything else (1,
> for example), actime is reflected accurately by stat.
> 
> Am I off base?  The same code on my Debian box returns
> the epoc for atime (instead of the modtime value).
> 
> Does this make sense?

Would you mind to create a small testcase?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2001-11-14 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-11  8:26 utime Bug? chad fowler
2001-11-11  8:26 ` egor duda
2001-11-11  8:26   ` chad fowler
2001-11-11  8:26     ` Corinna Vinschen
2001-11-11  8:26 ` Corinna Vinschen

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 read-only IMAP folder(s) and NNTP newsgroup(s).