Re: [msysGit] Re: [PATCH v4 5/5] mingw_rmdir: set errno=ENOTEMPTY when appropriate
- From
Erik Faye-Lund <kusmabite@gmail.com>
- Date
- Feb 7, 2011, 21:57 UTC
- Message-ID
- <AANLkTi=r1Ujz7RXTTepiVUCMNRWUmydTeOmUkyd1+AC4@mail.gmail.com>
- In-Reply-To
- <7vk4hbtsro.fsf@alter.siamese.dyndns.org>
On Mon, Feb 7, 2011 at 10:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 26 quoted lines
> Erik Faye-Lund <kusmabite@gmail.com> writes:
>
>> On Mon, Feb 7, 2011 at 10:18 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
>> ...
>>> I think Johannes was referring to the case when a directory is busy.
>>> E.g. a process is running that has its working directory inside that
>>> directory. In that case ENOTEMPTY was not returned even though the
>>> directory is not empty. Thats what I read from the patch.
>>
>> I don't think that's the case either:
>> $ echo "int main() { while (1); }" | gcc -x c - -o foo/bin.exe
>> [kusma@HUE-PC:/git@work/xgetenv]
>> $ foo/bin.exe &
>> [2] 3188
>> [kusma@HUE-PC:/git@work/xgetenv]
>> $ ./a.exe
>> rmdir: Directory not empty
>> errno: 41 (expected 41)
>
> I don't do windows, but I think Heiko is talking about running some
> process inside the directory that is getting removed. Assuming that your
> a.exe is to remove the 'foo' directory, you would need to run ./bin.exe
> after going into 'foo' directory, perhaps like this:
>
> $ (cd foo && ./bin.exe) &
> $ ./a.exeOf course, silly me:
$ ./a.exe rmdir: Permission denied errno: 13 (expected 41)
Thanks for clearing that up, now I'm on board :)