[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autotest vs. in-use directories

From: Eric Blake
Subject: Re: autotest vs. in-use directories
Date: Thu, 9 Apr 2009 18:24:29 +0000 (UTC)
User-agent: Loom/3.14 (

Ralf Wildenhues <Ralf.Wildenhues <at>> writes:

Hi Ralf,

> it's really sad that, while Cygwin adds POSIX-like functionality, it
> seems it always only gets it half-right, and that then requires other
> hacks in other tools to work around the remaining deficiencies.  :-/

Actually, this one turned out to be a gcc upgrade issue!

The inability to recreate a deleted in-use directory should now patched in 
cygwin, although I haven't yet had a chance to rebuild and validate Corinna's 
patch (I am, however, amazed at how fast she pinpointed a fix for the issue, 
especially given how obtuse the patch is in relation to what is being fixed):

But the point of this patch is not cygwin's (temporary) inability to recreate 
an in-use directory, but the fact that deleting an in-use directory has other 
negative effects on all platforms, leading to confusing messages when your 
interactive shell's current working directory is suddenly made stale even 
though a (new) directory by the name of $PWD still exists.

> * Eric Blake wrote on Thu, Apr 09, 2009 at 07:21:58PM CEST:
> > So I'm thinking about applying this patch.  Rather than changing
> > autoconf's testsuite to use 'exec ./run' (which does indeed make the
> > failing tests once again pass for cygwin 1.7, but doesn't help the
> > interactive user who won't want to end their session by using exec), I
> > decided to fix autotest to quit trying to remove the entire directory,
> > but instead only remove its contents.  I believe I got the glob
> > correct for deleting all hidden files but not '.' nor '..'.
> > +    rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* ||
> Just for safety, I'd remove the directory last.  Also, why is this not
> sufficient?
>    rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.]* || ...
> since this is only globbing, not regular expressions.

No, the point of the above change is that I'm NOT deleting the current 
directory.  Rather, I'm using ALL THREE globs to collectively name every 
possible file within the directory (think 'a', '...', and '.a', each of which 
only match one of the three globs), so that after the rm call, the directory 
should still exist but be empty.  My question was more whether I am correct 
that 3 globs is sufficient to cover all cases, and that we don't need 4, and 
that no one else knows any trick to make it possible to reduce to 2 globs.

> However, there are also other issues.  For example, I test Libtool on
> AIX on an NFS system.  AIX keeps some shared libraries (with sufficient
> permissions) in memory even after all programs loading them have exited,
> in order to be able to start new programs faster that use them too.
> Unloading the libraries can only be done by root, which I am not.
> This causes "interesting" errors when rerunning tests.  I have not yet
> checked whether your patch would help or hurt this situation.

About all my patch does is narrow the set of file system objects that get 
deleted by one (beforehand we tried to rmdir the directory, now we don't).  If 
I understand things, my change from 'rm -rf $dir' to 'rm -rf $dir/contents' 
won't really help AIX (the attempt to delete any in-use shared libraries from 
the per-test subdir will still occur).

Eric Blake

reply via email to

[Prev in Thread] Current Thread [Next in Thread]