[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [lmi-commits] master 8f7ad46 2/3: Resolve a unit-test failure
From: |
Greg Chicares |
Subject: |
Re: [lmi] [lmi-commits] master 8f7ad46 2/3: Resolve a unit-test failure |
Date: |
Mon, 17 Aug 2020 01:58:03 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 2020-08-16 23:47, Vadim Zeitlin wrote:
> On Sun, 16 Aug 2020 19:34:52 -0400 (EDT) Greg Chicares
> <gchicares@sbcglobal.net> wrote:
>
> GC> Commentary explains why std::filesystem::remove() deletes a
> GC> directory that the msw C runtime's remove() does not. C99 (N1256) says
> GC> [7.19.4.1] "If the file is open, the behavior of the remove function
> is
> GC> implementation-defined", but this directory doesn't seem to be "open",
> GC> and apparently the msw implementation simply refuses to remove any
> GC> directory.
>
> I'm too lazy to check the standard (and MSVC doesn't follow nor claim to
> support this one anyhow), but I'd be surprised if it mandated that remove()
> work for the directories.
Yes, I think you're right. I had been reading the C++17 filesystem
documentation first, and then the POSIX documentation. Later, when
I read the C standard, I assumed that it used 'file' as a generic
term meaning "file or directory"; but that's not justified, and
that standard never mentions directories at all.