Write through symlinks for schematics and PCBs
This commit is contained in:
parent
891e200fc8
commit
542c02046b
|
@ -109,6 +109,18 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SHEET* aSheet, bool aSaveUnderNewName )
|
||||||
schematicFileName.SetExt( KiCadSchematicFileExtension );
|
schematicFileName.SetExt( KiCadSchematicFileExtension );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __WINDOWS__
|
||||||
|
// Write through symlinks, don't replace them
|
||||||
|
if( schematicFileName.Exists( wxFILE_EXISTS_SYMLINK ) )
|
||||||
|
{
|
||||||
|
char buffer[ PATH_MAX ];
|
||||||
|
char *realPath = realpath( TO_UTF8( schematicFileName.GetFullPath() ), buffer );
|
||||||
|
|
||||||
|
if( realPath )
|
||||||
|
schematicFileName.Assign( wxString::FromUTF8( realPath ) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !IsWritable( schematicFileName ) )
|
if( !IsWritable( schematicFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -943,6 +943,18 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
|
||||||
if( pcbFileName.GetExt() == LegacyPcbFileExtension )
|
if( pcbFileName.GetExt() == LegacyPcbFileExtension )
|
||||||
pcbFileName.SetExt( KiCadPcbFileExtension );
|
pcbFileName.SetExt( KiCadPcbFileExtension );
|
||||||
|
|
||||||
|
#ifndef __WINDOWS__
|
||||||
|
// Write through symlinks, don't replace them
|
||||||
|
if( pcbFileName.Exists( wxFILE_EXISTS_SYMLINK ) )
|
||||||
|
{
|
||||||
|
char buffer[ PATH_MAX ];
|
||||||
|
char *realPath = realpath( TO_UTF8( pcbFileName.GetFullPath() ), buffer );
|
||||||
|
|
||||||
|
if( realPath )
|
||||||
|
pcbFileName.Assign( wxString::FromUTF8( realPath ) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !IsWritable( pcbFileName ) )
|
if( !IsWritable( pcbFileName ) )
|
||||||
{
|
{
|
||||||
wxString msg = wxString::Format( _( "No access rights to write to file \"%s\"" ),
|
wxString msg = wxString::Format( _( "No access rights to write to file \"%s\"" ),
|
||||||
|
|
Loading…
Reference in New Issue