[cfe-dev] libclang locking files for write/delete on windows

Kim Gräsman kim.grasman at gmail.com
Mon Dec 8 11:32:01 PST 2014


On Mon, Dec 8, 2014 at 8:02 PM, Reid Kleckner <rnk at google.com> wrote:
> We use this code to open files for reading on Windows:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?view=markup#l756
>
> See the FILE_SHARE_READ | FILE_SHARE_WRITE flags. We could add
> FILE_SHARE_DELETE and see if that fixes your problem.
>
> Note that locking files against writes or deletions while reading them is
> pretty common on Windows. MSVC, for example, does this to sources and
> headers during compilation.

Oh, and here's another one:
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?view=markup#l554

It seems to require exclusive access if Mode == readonly, which seems
a little backwards.

This probably isn't used in this code path, though.

- Kim



More information about the cfe-dev mailing list