surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.1k stars 395 forks source link

Recursive create user path on windows #7670

Closed baconpaul closed 2 months ago

baconpaul commented 3 months ago

thanks one drive!

a one drive user had the os say documents existed in one drive but the directory wasn’t there. Since we create not recursively create %Documents%/surge xt it failed until user made parent documents dir

so change to create recursively on windows startup i guess!

baconpaul commented 2 months ago

Huh so we already do this

    auto needToBuild = false;
    if (!fs::is_directory(p) || !fs::is_directory(userPatchesPath))
    {
        needToBuild = true;
    }

    if (needToBuild)
    {
        try
        {
            for (auto &s : {userDataPath, userDefaultFilePath, userPatchesPath, userWavetablesPath,
                            userModulatorSettingsPath, userFXPath, userWavetablesExportPath,
                            userSkinsPath, userMidiMappingsPath})
                fs::create_directories(s);

that call to create_directories creates all elements of p which dont exist in order.

So there's no additional code change we can make here.

I suppose we can check if your documents directory exists on windows and throw an error earlier?

baconpaul commented 2 months ago

well that would basically be what we do now except it would throw an error in the event that create_directories would. There's nothing to change in our code here. Closing the issue.