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?