cjcliffe / CubicSDR

Cross-Platform Software-Defined Radio Application
http://www.cubicsdr.com
GNU General Public License v2.0
2.02k stars 249 forks source link

Cannot record into /tmp #823

Open TJNII opened 4 years ago

TJNII commented 4 years ago

When the recording path is set to /tmp recording fails with the following error:

Recording path does not exist or is not writable.  Please use 'Set Recording Path' from the 'File' Menu.

However, if I create a subdirectory in /tmp, such as /tmp/Recordings, then the recording feature works as expected. /tmp has standard permissions:

$ ls -ld /tmp/
drwxrwxrwt 1 root root 4096 May 26 11:12 /tmp/

Looking at the code I see this is coming from appConfig.cpp:

   wxFileName recPath(recPathStr);

    if (!recPath.Exists() || !recPath.IsDirWritable()) {
        wxMessageBox( wxT("Recording path does not exist or is not writable.  Please use 'Set Recording Path' from the 'File' Menu."), wxT("Recording Path Error"), wxICON_INFORMATION);

        return false;
    }

This appears to be a bug in recPath.IsDirWritable(), I'm putting together a minimal example.

TJNII commented 4 years ago

I published a minimal example at https://github.com/TJNII/wxWidgets_wxFileName_tmp_example. It looks like wxWidgets uses their own bugtracker, I'd prefer to not set up an account just to report this as I don't currently use wxWidgets myself. Do any of the maintainers here have an account upstream to report this?

~Workaround for this project is to make sure to use a trailing slash for /tmp/.~ EDIT: Remove this as the GUI doesn't allow adding the trailing slash.