UPDATE: I did some analysis of what happens with the locking and it looks like QGIS doesn't use an exclusive lock. It just requires (non-exclusive?) write lock to the file. So this C# code fails:

File.Open (fileName, FileMode.Open, FileAccess.Read, FileShare.Read);

the error being: System.IO.IOException : The process cannot access the file '...' because it is being used by another process

while this one goes through:

File.Open (fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

So my question is basically off the mark and I'll move to close it.

In QGIS, when you open a shapefile in read-only mode, the shapefile still gets to be exclusively locked by QGIS, preventing other programs from reading it at the same time. This is pretty annoying and basically unnecessary, since you're not really editing the shapes or attributes of the file (and even if you were, the read access should still be allowed).

Is there a way to open the shapefile without locking it out for other software?

  • Use LINUX!!! In Linux you are able to do anything you like to a shp-file that is already opened in QGIS. – SS_Rebelious Sep 24 '12 at 19:13
  • Yes, very helpful answer. Too bad I can't -1 it. And anyway, that's not an OS issue, it's the QGIS issue. – Igor Brejc Sep 24 '12 at 19:16
  • 2
    Really? I have found the exact opposite in that Arc usually locks the file. I can have the file open in arc and then edit it in qgis and the changes are reflected in arc as well. – GeorgeC Sep 24 '12 at 22:33
  • @GeorgeC you're right, I've updated the question. – Igor Brejc Sep 25 '12 at 4:52
  • 1
    I find this exclusive file lock annoying especially when you analyse information from external sources. I wrote myself a plugin that copies shapefile content in *.sqlite to avoid this problem and work on same shapefile in external programs. – Greg Apr 11 '16 at 6:16

Browse other questions tagged or ask your own question.