Comment 2 for bug 1042554

Revision history for this message
Dick Hollenbeck (dickelbeck) wrote : Re: [Bug 1042554] [NEW] Saving footprint in pcb footprint library editor crashes on linux

On 08/28/2012 01:09 AM, kuba.fra wrote:
> Public bug reported:
>
> When saving footprint to my new footprints library (*.mod) on linux I've
> received following error:
>
> IO_ERROR: Unable to rename tempfile '/tmp/EMDR_LightFootAdLpsC' to to library file 'EMDR_LightFoot.mod'
> from /build/buildd/kicad-0.0.201208262046+3684~10~lucid1/kicad/pcbnew/legacy_plugin.cpp : Save() : line 4128
>
> At first I've checked access permissions to /tmp directory and my
> project directory.
>
> Then I've checked this part of code and there is a function:
>
> if( wxRename( tempFileName, m_lib_name ) )
> {
> THROW_IO_ERROR( wxString::Format(
> _( "Unable to rename tempfile '%s' to to library file '%s'" ),
> tempFileName.GetData(),
> m_lib_name.GetData() ) );
> }
>
> The function wxRename returns different results on Windows, MacOs and
> Linux.

Please tell me how you know this last statement, such as a documentation reference or
source code line. I run linux and am not seeing your error for example.

>
> Consider this function: wxRenameFile
> http://docs.wxwidgets.org/stable/wx_filefunctions.html#wxrenamefile

UI functions are not allowed in a plugin, and wxRemoveFile() puts up a dialog under some
circumstances.

Can you please verify that wxRenameFile will never puts up a dialog function under any
circumstances. This means checking the source code to wx.