Not able to save state slots

mkdir is used to make a directory, so you use it whenever you want to create a new directory. It’s the same as creating a new folder with your file manager.

You should use sudo only when you need to run a certain command not as your user account, but as root. This is usually limited to operations that modify files that are owned by root, files which are outside your home directory. This includes operations like installing packages or updating your system. If you are in doubt, you should first try without sudo and then pay attention to the error message. If the error message is something like “Permission denied” or “you cannot perform this operation unless you are root”, that means exactly that. Then think twice do you really want to perform this operation as root, and if you do, then you need sudo. Just make sure you know exactly what you’re doing and why root privileges are necessary for it. The time it takes you to type sudo is well spent thinking about what are you doing :wink:

You should never use sudo in the following situations:

  1. when the command works fine without sudo
  2. with any GUI program (including, but not limited to GUI text editors and file managers)
  3. when building packages for ALPM (i.e. with makepkg or with yay)
  4. with 3rd party package managers, like pip, npm, gem (this is especially important on Arch, on other distros you may need to).
  5. with wine

I call these use cases: sudon't :slight_smile:

Anyway, since the issue is solved and you seem curious, here is my thought process how I came up with that mkdir. It’s really simple, no big brain needed.

First, I saw your error message when trying to save the game: “Error creating file ∕home/username/.local/share/visualboyadvance-m/dark-cry-something-something.sgm”

So my initial thought was: “this guy probably messed up the permissions in his home directory so now he cannot create this file” and to test it I had you run that \ls -la command. The backslash just makes sure you’re not using any aliases (it’s very typical to have aliases with ls). The ls command means list files. The -la flags mean: show a long listing of all files. Long listing, among other things, includes permissions and ownership.

What I wanted to see was the permissions and ownership of that directory, expecting it to be owned by root. This could happen if you, for example, ran that emulator with sudo (if that were the case I would warn you against using sudo with GUI programs, and tell you to use chown to fix the ownership of that directory). However, the command printed the error message stating clearly that the directory did not exist. So the obvious thing that came to my mind was: create the missing directory, and mkdir is the command used for that…

That’s pretty much it, just read what the error message says.

OK sir.

I will remember it and had taken the note of it. :saluting_face: