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
(cherry picked from commit 6896148a10
)
This commit is contained in:
parent
2e54232181
commit
32930319ea
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue