Mail Archives: cygwin/2011/04/26/12:42:41
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 -