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() )
|
if( filename.IsEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
wxLogTrace( LCK, "Trying to lock %s", filename );
|
||||||
wxFileName fn( filename );
|
wxFileName fn( filename );
|
||||||
fn.SetName( "~" + fn.GetName() );
|
fn.SetName( "~" + fn.GetName() );
|
||||||
fn.SetExt( fn.GetExt() + ".lck" );
|
fn.SetExt( fn.GetExt() + ".lck" );
|
||||||
|
|
||||||
if( !fn.IsFileWritable() )
|
if( !fn.IsDirWritable() )
|
||||||
{
|
{
|
||||||
|
wxLogTrace( LCK, "File is not writable: %s", filename );
|
||||||
m_status = true;
|
m_status = true;
|
||||||
m_removeOnRelease = false;
|
m_removeOnRelease = false;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue