Mail Archives: cygwin/2006/04/22/11:17:30
On 22 April 2006 15:40, Robert J. Cristel wrote:
> Hello Corinna,
I'm not Corinna!
> mingw-install-20060210
> is experiencing a problem
> "tar: ssl/man/man1/md2.1.lnk: Cannot
> utime: Permission denied"
> with win98 that you solved a while back
> http://www.cygwin.com/ml/cygwin/2002-05/msg00901.html
>
> We would like to apply the same medicine
> that you found. What would you suggest?
>
> -Robert J. Cristel
> Montreal, Canada
My suggestion: check the ChangeLog around that date, then look in the cvs
history to find the patches, then see how they worked. Let's see:
2002-05-17 Corinna Vinschen
* times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when
opening file for writing timestamp.
* wincap.cc: Remove flag has_specific_access_rights.
* wincap.h: Ditto.
Looks like the patch you're looking for. Probably all you need to do is
modify the mingw utimes implementation in the same way? Let's see...
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/times.cc?cvsroot=src
Uhuh. It's rev. 1.32. Let's take a look at it:
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/times.cc.diff?r1=1.31&r
2=1.32&cvsroot=src
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/times.cc,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- src/winsup/cygwin/times.cc 2002/05/12 01:50:38 1.31
+++ src/winsup/cygwin/times.cc 2002/05/17 08:32:29 1.32
@@ -440,12 +440,11 @@
}
/* MSDN suggests using FILE_FLAG_BACKUP_SEMANTICS for accessing
- the times of directories. FIXME: what about Win95??? */
+ the times of directories. */
/* Note: It's not documented in MSDN that FILE_WRITE_ATTRIBUTES is
sufficient to change the timestamps... */
HANDLE h = CreateFileA (win32.get_win32 (),
- wincap.has_specific_access_rights () ?
- FILE_WRITE_ATTRIBUTES : GENERIC_WRITE,
+ FILE_WRITE_ATTRIBUTES,
FILE_SHARE_READ | FILE_SHARE_WRITE,
&sec_none_nih,
OPEN_EXISTING,
Right, so the answer is you need to open the file with write perms if you
want to change the timestamp.
Ah, it seems mingw doesn't provide it's own utime implementation but relies
on the one in msvcrt, which is documented to return:-
" EACCES
Path specifies directory or read-only file "
which is a problem; tar expects utime to behave in a POSIX compliant way, and
to be able to set the timestamp if the relevant unix perms exist. I don't use
mingw so I'm not sure, but wouldn't running tar under MSYS provide it with the
sort of POSIX-alike environment it needs? Otherwise perhaps it's possible to
re-implement utime as a wrapper in the mingw runtime library?
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -