Cannot use file paths with spaces and parentheses when configuring controls through retroarch
-
Pi Model or other hardware: 4 B
Power Supply: 5.1V || 3 A
USB Devices connected: keyboard, mouse
Controller used: arcade buttons and joysticks via USB Encoder
32 GB SD Card (retropie), 64 GB USB Flash Drive (roms)I was trying to follow this guide for manually configuring retroarch controls.
I initially tried configuring the controls for a single ROM by typing
sudo nano /home/pi/RetroPie/roms/n64/Star Wars - Rogue Squadron (USA).n64.cfg
into the command prompt. For some reason, that led to -bash: syntax error near unexpected token '('. Assuming the issue was the spaces and the parentheses, I renamed the rom to SWRogueSquadron and that brought up a file, but it was totally empty. Not sure if that is expected behavior.
Editing the controller configuration system-wide (also in the link above) seems to work, but I was just curious if there is any way to edit the configuration for a single rom without having to change the name of the rom.
-
@helloThere Wrap the path in quotes
"path"
. Or use tab to autocomplete the filename which will quote the characters like(
to\(
-
Also you shouldn't use sudo here.
-
Thanks, that did the trick.
The file is totally empty, though. Shouldn't config files by default have at the very least a couple of commented lines?
-
There are no per rom configs by default (not sure how there could be!). You are creating a new .cfg file in your example.
-
Alright, thanks. I'm not super experienced with retropie.
@BuZz said in Cannot use file paths with spaces and parentheses when configuring controls through retroarch:
Also you shouldn't use sudo here.
by the way, other than being kinda unnecessary, could using sudo in front of the file path cause any issues?
-
That depends. First and foremost, it's a secure behaviour to only give yourself administrator rights (e.g. via sudo) when absolutely necessary. Also, if you happen to change the file's owner or permissions by accident in a way that the normal user can't access them anymore, it can cause further problems.
In short, by training yourself to use
sudo
only when necessary you avoid future problems and, at worst, security holes.In your particular case, mere editing an existing file shouldn't make you any trouble, but if the file doesn't exist, you'll create it with the owner
root
instead ofpi
. Because a new file will be created with only write permissions for the owner, any application like an emulator that's run bypi
wouldn't be able to write to this file afterwards.Again, that may or may not be a problem depending on the file, but avoiding to use sudo will negate this uncertainty alltogether.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.