Eric Blake wrote:
> Jim Meyering meyering.net> writes:
>
>> > Meanwhile, the rmdir-errno module, in use by coreutils until today, guessed
>> > wrong for cross-compilation to Solaris (where rmdir fails with EEXIST, not
>> > ENOTEMPTY, on a populated directory); now that coreutils no longer uses th
Jim Meyering meyering.net> writes:
> > Meanwhile, the rmdir-errno module, in use by coreutils until today, guessed
> > wrong for cross-compilation to Solaris (where rmdir fails with EEXIST, not
> > ENOTEMPTY, on a populated directory); now that coreutils no longer uses the
> > module [1], I see n
Eric Blake wrote:
> Eric Blake byu.net> writes:
>> > I'm arguing that the second program should also report "No such
>> > file or directory".
>>
>> Ah, so for 'foo/', the code should distinguish between ENOENT and ENOTDIR,
>> based on whether 'foo' exists. I'll update the patch and test according
Eric Blake byu.net> writes:
> > I'm arguing that the second program should also report "No such
> > file or directory".
>
> Ah, so for 'foo/', the code should distinguish between ENOENT and ENOTDIR,
> based on whether 'foo' exists. I'll update the patch and test accordingly.
I'm taking a step
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Ben Pfaff on 9/14/2009 8:42 PM:
>
> I'm arguing that the second program should also report "No such
> file or directory".
Ah, so for 'foo/', the code should distinguish between ENOENT and ENOTDIR,
based on whether 'foo' exists. I'll upd
Eric Blake writes:
> According to Ben Pfaff on 9/14/2009 5:51 PM:
>>> + /* Mingw remove("file/") fails with EINVAL, instead of the required
>>> + ENOTDIR. */
>>> + if (ISSLASH (name[len - 1]))
>>> +{
>>> + errno = ENOTDIR;
>>> + return -1;
>>> +}
>>
>> I believe that thi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Ben Pfaff on 9/14/2009 5:51 PM:
>> + /* Mingw remove("file/") fails with EINVAL, instead of the required
>> + ENOTDIR. */
>> + if (ISSLASH (name[len - 1]))
>> +{
>> + errno = ENOTDIR;
>> + return -1;
>> +}
>
> I b
Eric Blake writes:
> + if (lstat (name, &st) == 0 && S_ISDIR (st.st_mode))
> +{
> + /* Mingw rmdir("empty/.") mistakenly succeeds. */
> + while (ISSLASH (name[len - 1]))
> +len--;
> + if (name[len - 1] == '.' && (1 == len || ISSLASH (name[len - 2])))
> +{
> +
mingw remove() complies with C89, but not with POSIX. I'll be committing this
shortly (actually, first I probably need to commit a stat module, to make up
for the fact that both mingw rmdir("dir") and rmdir("dir/") can succeed, even
when one of stat("dir") and stat("dir/") fails, depending on w