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

Kim Gräsman kim.grasman at gmail.com
Sat Dec 6 03:03:40 PST 2014


On Sat, Dec 6, 2014 at 11:01 AM, Manuel Klimek <klimek at google.com> wrote:
> So, I think the general problem is that Windows by default does not allow
> multiple applications to have a file open. The question is whether we could
> get libclang to read all the files into memory instead of keeping them
> open...

Yes and no. Everybody opening a file can specify a share mode, e.g.
"share for read", "share for write" or "exclusive access".

Depending on the share mode for other open handles to the same file,
the next open attempt will fail or succeed.

I don't know if LLVM/Clang or some other app on Ivan's system is
opening the files with exclusive access, but if it's Clang, maybe the
requested share mode could be lowered to read-only?

- Kim



More information about the cfe-dev mailing list