Command to edit file permissions (solved)
-
Sorry guys to annoy you with basics: could someone give me the right command to change the permissions of a file?
I want to get rid of the write protection of the nvrams of Atomiswaves "Metal Slug 6".
I dont have a PC, so i have to use the terminal on the Pi.
Would "sudo chmod ugo-rwx [path]" work? -
@sirhenrythe5th
I think you have it correct but I wonder if it should beugo+rwx
orugo=rwx
instead since you would be stating either to "add" those permissions or permissions "equal" such and such.I only learned the octal form of the command so that would be
sudo chmod 777 <path/file>
-
@yfzdude said in Command to edit file permissions:
I wonder if it should be ugo+rwx or ugo=rwx instead
In this case I think they are equivalent, since you are adding or setting all three.
If a file was
r--
and you do achmod +w
it will becomerw-
. But if you didchmod =w
then it would just become-w-
.When you're doing all three, whether you "set" them or "add" them, the result is still
rwx
, either way.Also you can use
a
(all) instead ofugo
.chmod a+rwx <file>
.There's no reason nvram should be executable though, right? So you probably want
a=rw
actually.Additionally, (a)ll is the default if none of (u)ser, (g)roup, nor (o)ther are specified so really you can just use
=rw
.Edit: oh I see, @sirhenrythe5th said
-
and you were suggesting either+
or=
instead, not suggesting+
instead of=
like I thought.I want to get rid of the write protection of the nvrams of Atomiswaves "Metal Slug 6".
I dont have a PC, so i have to use the terminal on the Pi.
Would "sudo chmod ugo-rwx [path]" work?You want to "get rid of the write protection" so it's no longer protected and so after the operation the file will be writable? Or you want to get rid of write permissions so the file becomes read-only? You probably don't want to do
-r
in either case, as then you wouldn't be able to read from it at all (I think?)Use
=r
or=rw
to make it either read-only or read-write, for all users.(I just googled this like five minutes ago so don't take my word for it but I think this is how it works.)
-
Thank you both very much, very helpful Information!!!
You are right, it is not necessary to add executable permissions to the nvram, and as far as no special groups or users are involved the parameter "a" will be perfect.By saying "get rid" of write protection i meant that i want to allow the system to write the file.
Metal Slug 6 has the issue that it only runs once and does not start anymore on further trys.
I read in another thread here that this is caused by the created nvram-files and can be fixed by either deleting the files after every start, or changing the file permissions to writeable. -
@sirhenrythe5th
probably stating the obvious here but I like the ease of using Pixel desktop for managing files & folders -
@sirhenrythe5th said in Command to edit file permissions:
I read in another thread here that this is caused by the created nvram-files and can be fixed by either deleting the files after every start, or changing the file permissions to writeable.
I've not done this myself but if I'm reading correctly, that thread says to disable the write permissions of the files, that is to say to enable write protection so the file is unwritable and cannot be altered. I think you are supposed to use
chmod =r <file>
to make it read-only for all users. -
@sleve_mcdichael sorry, i am not an english native speaker, so i may have problems to explain in the right way.
It is all about this thread:
https://retropie.org.uk/forum/topic/25835/atomiswave-problems-with-metal-slug-6-and-kof-neowave?_=1632123223808
I have this issue running MS6 more than one time and want to do this:*"I figured it out a while ago
Run the Atomiswave games once and let it generate the nvmem and nvmem2 files ... play the game for a bit, then exit it.
After that, disable Write Permissions and the game will work fine the next time you launch it ... without needing to delete the nvmem and nvmem2 files ever again.
With Write Permissions enabled .. the 2nd time you launch the game, it just hangs at the Notice ~ All Backup Data Was Cleared screen.
I used WinSCP to disable the Write Permissions for my entire Atomiswave rom folder."*
As i dont have a PC, i cannot use SSH, Putty, WinSCP.
Thats why i search for the right terminal command.
I hope this is more understandable. -
So I think I have the picture now. This is what you would want to do.
- Delete the
nvmem
andnvmem2
files if they are present and the game isn't running. - Run the game once so it generates the two files. Then exit to command line.
- Type
sudo chmod a-w <path/nvmem>
andsudo chmod a-w <path/nvmem2
. - Now it should run each time without problem.
The thread mentioned removing the ability for anything to write to the files after they are initially created. It seems the second launch edits the data and causes some kind of corrupted file.
- Delete the
-
@yfzdude thank you!!! I will do so in the evening :)
-
thanks to everyone: it worked! :D
In the end it was not worth the afford, i just run into another issue: when i change settings (language, continues) in the atomiswave-servicemenu and push "save & exit" the whole system freezes :D :D (even with fresh nvrams without changing the permissions).
But that is ok, i played around and IMO Metal Slug 6 is not the best part off this series, i ignore it for the moment.
I learned new linux-commands and that is good anyway ;)
-
@sirhenrythe5th said in Command to edit file permissions (solved):
run into another issue: when i change settings (language, continues) in the atomiswave-servicemenu and push "save & exit"
I mean, yeah. You've just made the nvram read-only, and now you're trying to save changes to it. That ain't gonna work. You'd have to do all that before you locked the file, while it was still writable.Oops! Missed the part where you said it even happens without changing the permissions.
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.