Prevent ro directories from showing lockfile error

(cherry picked from commit d94fd5f979)
This commit is contained in:
Seth Hillbrand 2023-05-30 11:21:41 -07:00
parent f974c8259e
commit 8648017b42
2 changed files with 11 additions and 1 deletions

View File

@ -230,7 +230,10 @@ bool EDA_DRAW_FRAME::LockFile( const wxString& aFileName )
m_file_checker = std::make_unique<LOCKFILE>( aFileName );
return m_file_checker->Locked();
// If the file is not valid, or is successfully locked, return true
// Invalid lockfiles are the result of bad permissions, so this is
// likely not a file that we can override regardless
return !m_file_checker->Valid() || m_file_checker->Locked();
}

View File

@ -52,6 +52,13 @@ public:
fn.SetName( "~" + fn.GetName() );
fn.SetExt( fn.GetExt() + ".lck" );
if( !fn.IsFileWritable() )
{
m_status = true;
m_removeOnRelease = false;
return;
}
m_lockFilename = fn.GetFullPath();
wxFile file;