X-Spam-Check-By: sourceware.org From: "Dave Korn" To: Subject: RE: regarding a problem that you know how to fix Date: Sat, 22 Apr 2006 16:17:18 +0100 Message-ID: <02f201c6661f$d88aeb40$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <444A402A.7020506@sympatico.ca> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/