From 6896148a104dbf3532418aff5684b05d925aaeb7 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 13 Jun 2023 11:16:09 -0700 Subject: [PATCH] Check for directory locking not file When creating a new file lock, we need to check if the containing directory can be written, not if the file (which may not yet exist) can be written Fixes https://gitlab.com/kicad/code/kicad/-/issues/14942 --- include/lockfile.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/lockfile.h b/include/lockfile.h index c0aa663a5d..a3c52a4dae 100644 --- a/include/lockfile.h +++ b/include/lockfile.h @@ -48,12 +48,14 @@ public: if( filename.IsEmpty() ) return; + wxLogTrace( LCK, "Trying to lock %s", filename ); wxFileName fn( filename ); fn.SetName( "~" + fn.GetName() ); fn.SetExt( fn.GetExt() + ".lck" ); - if( !fn.IsFileWritable() ) + if( !fn.IsDirWritable() ) { + wxLogTrace( LCK, "File is not writable: %s", filename ); m_status = true; m_removeOnRelease = false; return;