New locking model for SDF files
Split out and enlarge the set of functions dealing with files