I'm struggling right now with figuring out a way to move a juce::File (which is a vital file for the operation of my app) into an Application Support folder on the hard drive.
It's a simple text file called 'user.reg'. It needs to be located at:
/Library/Application Support/MY COMPANY/MY PRODUCT/user.reg
... but moving the file there is not working for me. I'm having 'permission denied' problems. Solutions I've thought of and tried:
- Making my app require a password / run as administrator. I could not for the life of me figure out how to make this happen.
- Using std::system to run a sudo mv command. Not working either.
The only other solution I've got is to create a temporary folder somewhere it will be erased eventually, put the file and an alias to the folder it's going to go in, and make the user manually 'drag the file' onto the alias to manually place it properly.
I mean, I'm totally sure that I'm missing something very convenient/obvious JUCE has built in that will help with these types of scenarios! It can't possibly be this complicated to move a file into Application Support! .... right?