CubicSDR icon indicating copy to clipboard operation
CubicSDR copied to clipboard

Cannot record into /tmp

Open TJNII opened this issue 5 years ago • 1 comments

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 avatar May 26 '20 17:05 TJNII

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.

TJNII avatar May 26 '20 17:05 TJNII