Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <17B78BDF120BD411B70100500422FC6309E31E@IIS000> From: Bernard Dautrevaux To: "'Tim Van Holder'" , Charles Wilson Cc: automake AT gnu DOT org, "'cygwin AT cygwin DOT com'" Subject: RE: Automake 1.4l released Date: Tue, 14 Aug 2001 11:13:48 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" > -----Original Message----- > From: Tim Van Holder [mailto:tim DOT van DOT holder AT pandora DOT be] > Sent: Monday, August 13, 2001 10:44 PM > To: Charles Wilson > Cc: automake AT gnu DOT org > Subject: Re: Automake 1.4l released > > > > > So IMHO, cygwin should recognize the "unusual" behaviour > of NTFS, and > > > perhaps internally do 'chmod +w; touch; chmod -w' when > changing the > > > timestamp of a read-only file. > > > > Omygod. You have NO idea how much overhead the necessary > checks would > > add -- it would slow down file access on cygwin to a crawl. > > Come on - does adding the code below to the utime() function > add that much > overhead? Getting the attributes should amount to a single > system call; > the same goes for setting them, and that is only needed if > the file isn't > writeable (if the overhead is noticeable, it might be > necessary to check > for NTFS-ness of the target, but I suspect always doing the > chmod would > be less overhead). > > curr_attr = GetFileAttr ("file"); > if (!WRITABLE(curr_attr)) > SetFileAttr ("file", WRITEABLE_ATTR); > ... > if (!WRITABLE(curr_attr)) > SetFileAttr ("file", curr_attr); > > (note: function names are mock-ups, but you get the idea) I'd rather, still using mock-up function names :-) : result = TouchFile("file") if (result < 0 && errno == EACCESS) { curr_attr = GetFileAttr ("file"); if (!WRITABLE(curr_attr)) { if (SetFileAttr ("file", WRITEABLE_ATTR)) result = -1; else { result = TouchFile("file"); SetFileAttr ("file", curr_attr); } } } return result; This way I don't see which overhead we will have under CygWin (or any OS where we will do the same): just one more test if all works OK and some more work to have it work when it fails erroneously... > > Anyway, this is really something that should be talked over on the > cygwin mailing list (maybe you could make it a PR?) - Agreed; I forward this to cygwin ML, but keep it also on automake as it is important for the distcheck users to know what happens. > my point was > merely that I consider the cygwin/NTFS behaviour unusual, as a file's > readonly attribute generally applies to the file, not the metadata > kept by the file system for that file. I should agree here; ANY case where cygwin is different from traditional UNIX practice is disturbing. Regards, Bernard -------------------------------------------- Bernard Dautrevaux Microprocess Ingenierie 97 bis, rue de Colombes 92400 COURBEVOIE FRANCE Tel: +33 (0) 1 47 68 80 80 Fax: +33 (0) 1 47 88 97 85 e-mail: dautrevaux AT microprocess DOT com b DOT dautrevaux AT usa DOT net -------------------------------------------- -- 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/