delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/26/12:42:41

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,TW_CG,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Dan Grayson <dan AT math DOT uiuc DOT edu>
Subject: Re: untarring symlinks with ../ fails randomly
Date: Tue, 26 Apr 2011 16:42:02 +0000 (UTC)
Lines: 52
Message-ID: <loom.20110426T183318-691@post.gmane.org>
References: <BANLkTikh9rCN2GRwY3eW20H0isffN5fMUg AT mail DOT gmail DOT com> <BANLkTi=GZbtLmK-Sr06-M=5xXVFzPCi82w AT mail DOT gmail DOT com> <20110424121145 DOT GB30696 AT calimero DOT vinschen DOT de> <loom DOT 20110425T165316-628 AT post DOT gmane DOT org> <20110426074325 DOT GP3324 AT calimero DOT vinschen DOT de> <loom DOT 20110426T170653-639 AT post DOT gmane DOT org> <20110426152226 DOT GA22801 AT ednor DOT casa DOT cgf DOT cx>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:

> Cygwin doesn't change the creation time gratuitously.  Sounds like BLODA 
> to me.
> http://cygwin.com/acronyms/#BLODA
> 
> cgf

Good call!  I killed Vid.exe from Logitech and reduced the probability of
failure from 25% per file to 1%.  Sadly, killing other processes doesn't seem
to bring the probability down to 0%, but I'm still trying.  If anyone else
wants to give it a try, here is a better C program for testing, that tries 1000
times.




   /* 
 gcc -Wall ctime.c -o ctime && ./ctime
   */

#include <unistd.h>
#include <assert.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdio.h>

#define FN "temporary-file-junk"

int main () {
     int m = 0, n = 1000, i;
     for (i=0; i<n; i++) {
	  static struct stat s1, s2;
	  unlink(FN);
	  int fd = open(FN,O_EXCL|O_CREAT|O_WRONLY,0);
	  fstat(fd,&s1);
	  close(fd);
	  stat(FN,&s2);
	  if (s1.st_ctim.tv_sec != s2.st_ctim.tv_sec || 
	      s1.st_ctim.tv_nsec != s2.st_ctim.tv_nsec) 
	       m++,
	       printf("ctime changed %3d: %lu.%09lu -> %lu.%09lu\n", 
		      i,
		      s1.st_ctim.tv_sec, s1.st_ctim.tv_nsec, 
		      s2.st_ctim.tv_sec, s2.st_ctim.tv_nsec);
	  }
     unlink(FN);
     printf("ctime change ratio: %d / %d = %.2g\n",m,n,(float)m/n);
     return 0;
     }



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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