delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/13/08:53:29

X-Authentication-Warning: new-smtp1.ihug.com.au: Host p273-tnt2.syd.ihug.com.au [203.173.131.19] claimed to be acceleron
Message-ID: <018901c123f6$2b64fc50$0a02a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Cc: <djgpp-workers AT delorie DOT com>, <sandmann AT clio DOT rice DOT edu>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010808181731 DOT 27271C-100000 AT is> <007701c120c6$2d72db80$0a02a8c0 AT acceleron> <7458-Thu09Aug2001183844+0300-eliz AT is DOT elta DOT co DOT il> <00af01c12197$68628570$0a02a8c0 AT acceleron> <2561-Mon13Aug2001124204+0300-eliz AT is DOT elta DOT co DOT il>
Subject: Re: Windows 2000 patch for utime.c v1
Date: Mon, 13 Aug 2001 22:47:52 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Reply-To: djgpp-workers AT delorie DOT com

> > > Btw, did they work on directories, i.e. could you change the time
> > > stamp of a directory?
> > Yes I could change the time stamp of a directory on Win 2K.
>
> So at least we gained something by switching to 7143h.
>
> > On Win 98 when I tested it I could not change the timestamp of a
directory.
>
> Windows 9X (and DOS) don't allow to change the timestamp of a
> directory.  Function 7143h silently does nothing for a directory on
> those systems, while functions of the 57xx family cannot be used on a
> directory because they require a file handle, and you cannot `open' a
> directory.
>
> > Should setting time on a directory fail?
>
> It should fail if the OS doesn't let us do that.  So it should succeed
> on W2K and XP, but fail on other systems.  If you build `touch' with
> the latest patch to `utime', do you see this behavior?
No the latest patch utime_3.dif will not allow directory times to be
changed.
If you use the patch utime_2.dif file from the previos email then touch can
change directory time on Win2K, but fails on Win 98.

> > To save time again i have attached an updated utime.c patch that fails
when
> > trying to set the time on a directory as occurs with the exisiting code
on
> > Win 9x.
>
> Sorry, I don't understand: this code doesn't do anything special for
> directories.  What change against the previous version of this code
> stopped the support for directories?
>
The open() function cannot open directories and as such fails if the path in
a directory. The change is the position of the open(), before or after the
call to7143h. If it is before then we can't change the directory time, but
if it is after we can.

Lines moved were:
-   /* DOS wants the file open */
-   fildes = open(path, O_RDONLY);
-   if (fildes == -1) return -1;

Overall looks like utime_2.dif is the correct patch to use as it allows
directory times to be updated on Win2K.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019