TheOfficialFloW / VitaShell

Multi-functional file manager for PS Vita
GNU General Public License v3.0
1.41k stars 224 forks source link

Fix permissions when moving files #133

Closed yeeeeeeee closed 8 years ago

yeeeeeeee commented 8 years ago

It appears that when using the "move" command the permissions for the file that is beign moved are not being inherited from the new location, eg. I move a file from an unsafe folder to a safe folder and the file will still be marked as unsafe (a lot of people keep reporting they can't see their roms in emulators because of this). It can be inconvenient especially for people transferring files via QCMA, though using copy and paste works as a workaround if there is enough space on the card.

TheOfficialFloW commented 8 years ago

Safe/unsafe homebrews don't depend on the folders they are located at. It's a flag inside the eboot.bin that depends...

yeeeeeeee commented 8 years ago

Sorry I probably wasn't clear enough, I'm not talking about the vpk being safe or unsafe, I'll give you another practical example. Since some versions of henkaku some folders have become not visible from, let's say, retroarch. So if a file is originally in a folder that in not visible to retroarch and you use the "move" command and move it to a folder that is visible, you will still not be able to see the file from retroarch. If instead you use copy and paste to do the same operation the file will be visible. I assume when using the "move" command some flag on the file is not updated to reflect the fact that it should be now considered visible. Hope this makes sense and by the way thanks for all the amazing work!

TheOfficialFloW commented 8 years ago

Please tell us how we can reproduce the problem.

yeeeeeeee commented 8 years ago

I don't have many homebrews installed so I can't say which other ones it's affecting, so I'll give you steps for the example I gave earlier with retroarch, any of the old separate cores or the new all in one vpk should do.

  1. Grab a rom of your choice and put it in a PSP savefile in your QCMA folder (I believe the videos folder is also not visible to retroarch so renaming it to mp4 and trasferring that way should work too)
  2. Transfer the PSP savedata to your vita
  3. In vitashell, create a folder inside ux0:data let's call it "roms" for this example.
  4. Browse to the location of the PSP savedata, select your rom and use the "move" command to move it to the "roms" folder that you just created.
  5. Open retroarch, select load content and browse to the "roms" folder, it will tell you there is no content.
  6. Go back to vitashell, select your rom and copy/paste it anywhere outside of the folder, delete the one inside the "roms" folder, then copy/paste the new copy back into the "roms" folder.
  7. Open retroarch again, select load content and browse to the "roms" folder, the rom should now be visible.
limyz commented 8 years ago

The move and copy commands share the same code - let us take a look into it. Also, you mentioned a lot of people - can you provide a link where they encounter the same problem?

EDIT: Ok I just quickly went through the site. It may be RetroArch's issue but not with VitaShell. If you are still encountering issues, consider transferring the file over FTP. Meanwhile, I will go through qcma's source code.

TheOfficialFloW commented 8 years ago

@limyz the move operation is not same as copy&paste. I will look at it

yeeeeeeee commented 8 years ago

Thanks, by the way here's some reports from other people as requested from limyz: https://www.reddit.com/r/vitahacks/comments/59jphb/retroarch_psx_wont_find_my_bin_game/ https://www.reddit.com/r/vitahacks/comments/54op7a/pcsx_help/ https://www.reddit.com/r/vitahacks/comments/567m39/pscx_rearmed_not_working/ https://www.reddit.com/r/vitahacks/comments/54nx7b/need_help_with_pcsx_rearmed_retroarch/d83nxb3/ https://gbatemp.net/search/33409603/?q=move&t=post&o=date&c[thread]=437034

Yes the workaround is using FTP or using copy/paste, not a lot of people know that and the question keeps showing up once in a while, that's why I thought it might be worth reporting.

TheOfficialFloW commented 8 years ago

@yeeeeeeee Thanks for telling us about this bug, I have just fixed it: https://github.com/TheOfficialFloW/VitaShell/commit/faa94dcaf2db339b855d5be278ba6ad867daf5c2