Moving Pnd Files On Sd Cards


benji_stein

Member
Joined
Nov 20, 2007
Messages
278
I tried looking around for info on this, but couldn't find any. Say I have a PND file on the SD card A. I insert A, it gets automounted and the PND appears in my menu. If I already have card B on the system, and I move the PND file from A to B, what happens? Does it still work? If I eject B does it disappear from the menu? What if I eject A?

Same thing if if move the PND to/from the onboard flash (if, for some reason I wanted to put one there). Will it even detect PNDs on the Pandora itself?

Maybe someone thought of this already, but I figured it was worth asking, since I can imagine people reorganizing on the Pandora, and things breaking, otherwise.
 
The way I understand it - libPnd polls a few key places on the SD slots every few seconds. If you move a PND from Card A to Card B it will dissappear breifly as the systems notices "HEY! You removed a program" and the notices "Hey! there's a new program over here" - It won't break as long as you aren't running the program at the time or doing anything hinky. You should always safely unmount your cards, not just eject them. This is true for any OS - including the Pandora.

I'm not sure if there is a place on the NAND that is polled by libPnd, but Skeezix said before you can edit the config to look in custom places - which could include the NAND. I wouldn't count on there being any room on the NAND for anything, the OS is going to take every byte it can.
 
Yes, definitely umount before ejecting; I implicitly consider that as part of the process.

If it's contstantly polling, then I guess that means it will also work if you just move the file to a different location on the same card.

You're right; NAND was the word I was looking for instead of onboard flash; shows you how long a day I've had. :(
 
If you move the PND around, it will first disappear from the menu (as it is gone from one SD card) and will then magically reappear at the same time as it has been found on the second SD Card.
It will then work out of the box.

If you have custom settings for that program, you also need to copy them over, as the PND will always use the appdata-directory on the same media where it is located.

That said, if you remove a card from slot 1 and reinsert it to slot 2, your PNDs will work as before, including custom settings.

The only thing that might not work directly are absolute paths you specified INSIDE of the app.
(i.e. if you told an emulator that the roms are in /media/mmcblk0p1/roms/ and put that card in Slot 2, the roms will be in /media/mmcblk1p1/roms/ and therefore the emulator won't find that path.) If you use a relative path and have the roms located inside of the appdata-directory for that app, this problem also won't occur.

So yes - you can move them around whereever you want, they will work.
 
This makes me wonder. What happens if you have a PND on both SD cards?

<edit>that is, a duplicate PND</edit>
 
Caine said:
This makes me wonder. What happens if you have a PND on both SD cards?

Then you have that app twice in your menu.
You could even have different versions of that app on your cards.
 
Last edited:
EvilDragon said:
If you move the PND around, it will first disappear from the menu (as it is gone from one SD card) and will then magically reappear at the same time as it has been found on the second SD Card.
It will then work out of the box.

If you have custom settings for that program, you also need to copy them over, as the PND will always use the appdata-directory on the same media where it is located.

That said, if you remove a card from slot 1 and reinsert it to slot 2, your PNDs will work as before, including custom settings.

The only thing that might not work directly are absolute paths you specified INSIDE of the app.
(i.e. if you told an emulator that the roms are in /media/mmcblk0p1/roms/ and put that card in Slot 2, the roms will be in /media/mmcblk1p1/roms/ and therefore the emulator won't find that path.) If you use a relative path and have the roms located inside of the appdata-directory for that app, this problem also won't occur.

So yes - you can move them around whereever you want, they will work.

What would happen if you just copied the PND onto both SD cards? Would libpnd create two seperate menu entries for the same app?
 
Last edited by a moderator:
I think we're having trouble because it just seems simple ... TOO simple. Can't we install things in obscure paths and dump registry entries and files all over the drive like in the olden days?
 
BWoodson said:
What would happen if you just copied the PND onto both SD cards? Would libpnd create two seperate menu entries for the same app?

EvilDragon said:
Caine said:
This makes me wonder. What happens if you have a PND on both SD cards?

Then you have that app twice in your menu.
You could even have different versions of that app on your cards.
 
Last edited by a moderator:
benji_stein said:
BWoodson said:
What would happen if you just copied the PND onto both SD cards? Would libpnd create two seperate menu entries for the same app?

EvilDragon said:
Caine said:
This makes me wonder. What happens if you have a PND on both SD cards?

Then you have that app twice in your menu.
You could even have different versions of that app on your cards.

:(

I hang my head in shame. I'm one of THOSE people now!!

:blink:
 
Last edited by a moderator:
dschroeter --

Yes, you can put pnd files wherever you like.

1) When we say /pandora/desktop for example, you can actually put them in /pandora/desktop/foo/bar/bam/biz/AwesomeApp.pnd and organize them there.. it should find them

2) You can put them any old place you want, and then just use a directory browser to find them and run them (file-associate .pnd to pnd_run and bam, good to go most of the time)

3) You can change the search paths in a conf file, so if you want it to search the entire SD, you can, or have it look in /whizzo instead of /pandora

4) Or you can run them from the command line if you want to, using pnd_run ;)

You can do pretty much whatever you like.

The onyl thign that is Unwise is running a pnd-app, then yanking the SD out _while_ its running.. since the fileystsem is still mounted, it'll piss off a lot of things. It won't hurt anything beside the apps thats running (you likely will crash it and loose changed data), but its still uncool :)

It really is a pretty nifty system :)

jeff
 
While we're on the subject of PNDs, if I have a game that I want to update the PND for will I lose my save file or is there a way to keep it?
 
Crunchy: Save files and configs should most likely be saved in: appdata-directory.

Similar to memory cards. You can download updates - appdata-directory is where addons and save files etc are.

Edit:
@ Skeezix - You guys have done so a goof f**king job! It's awesome!
 
kingoddball -- we'll see how much you like it when you have to use the bloody thing ;)

crunch -- yeah, he nailed it; if the porter did his job half-right, the app will be writing its changes back to appdata. (or worst case, to your homedir in NAND which would be annoying); in either case, swapping out the pnd with a newer version (or deleting it altogether) will not touch your data.

ie: A pnd file will not be self-edited; any writebacks will be redirected to its appdata on the same SD instead. So if you drop a new version in, it just picks up your same save data no problem.

jeff
 
mindlord said:
This is true for any OS - including the Pandora.

Except Windows.

Hey, I love alternate OS's, but this is one area where Windows is clearly superior, and has been since XP. :lol:

mindlord said:
not sure if there is a place on the NAND that is polled by libPnd
There isn't, by default. My opinion is there shouldn't be.

EvilDragon said:
If you have custom settings for that program, you also need to copy them over, as the PND will always use the appdata-directory on the same media where it is located.

Would it be possible to prompt to move the settings? Maybe link the files somehow, so moving one also moves the other?

dschroeter said:
I think we're having trouble because it just seems simple ... TOO simple. Can't we install things in obscure paths and dump registry entries and files all over the drive like in the olden days?

I was a fan of what Windows games started doing around the year 2000.

That is, dump everything - all settings, saves, maps, etc. - inside the app's own folder and subfolders.

Profile? What's that? The game can be run from any OS or user, and won't touch the profile or mess anything up. Hell, if you want you can toss it on your NAS and play it off a network drive.

But the new thing seems to be tying everything to your user profile, even on single-user systems. I don't like it. I use a lot of operating systems for various tasks, and it makes it harder to sync frequently used stuff (like games) between them. If I'm trying to do an objective comparison between Vista DX10 and WinXP DX9 framerates, it should be using the same files on my HDD, don't you think? Not a separate copy that could be fragmented, resulting in shorter/longer disk IO times, etc.

IMO Steam has it right - everything inside subfolders. Don't touch the profile, and try not to touch the registry. You can fire Steam up under a second OS, and most games will work fine. (though it does depend on the developer)

skeezix said:
The onyl thign that is Unwise is running a pnd-app, then yanking the SD out _while_ its running.. since the fileystsem is still mounted, it'll piss off a lot of things. It won't hurt anything beside the apps thats running (you likely will crash it and loose changed data), but its still uncool :)

I would expect things to misbehave if I did that.

I just don't like how ejecting things works in non-Windows OS's. I can copy a video to SD, and go off to eat lunch. I return 35 minutes later, and yank it out. Ubuntu complains about not ejecting first. When I put the card back in the card reader, I see the file I copied is completely corrupted.

In Windows, I tell it to copy the file - it copies minutes faster, and then I yank it out as soon as the light stops blinking. No issues.

It's such a superior experience for forgetful me. ;)

OSX is even worse than Ubuntu. My Uncle yanked his camera card out and completely corrupted it. It totally farked the filesystem; he thought the card was a goner, since it wouldn't show up in any OSX utilities, and he couldn't format it in his camera - but it was easy to reformat under WinXP/Win2k. Even once it was detectable in OSX, it wasn't usable. The .Trashes folder that OSX creates disagrees with his camera's OS, making it unreadable. And Ubuntu isn't much better, although it at least holds off on creating a trash folder until you first delete something. But it's not uncommon to delete a useless photo, so that's a total fail too. Windows (XP) ironically is the only clean OS that works with his camera. It warns you that deleting is permanent, when deleting a photo off a camera card. It makes no changes to the filesystem, and keeps nothing open if it doesn't have to. That's total win, and what the Pandora should strive for. As soon as you exit to desktop, you should be able to pull out your card with no issues, no complaints.

skeezix said:
ie: A pnd file will not be self-edited; any writebacks will be redirected to its appdata on the same SD instead. So if you drop a new version in, it just picks up your same save data no problem.

Even if they have different filenames?
 
Last edited by a moderator:
skeezix said:
2) You can put them any old place you want, and then just use a directory browser to find them and run them (file-associate .pnd to pnd_run and bam, good to go most of the time)

is there any reason that the OS shouldn't be shipped with this behaviour as default?
 
Last edited by a moderator:
Kramy said:
mindlord said:
This is true for any OS - including the Pandora.

ExceptEspecially Windows.

Hey, I love alternate OS's, but this is one area where Windows is clearly superiorexactly the same, and has been since XP. :lol:
Fixed that for you.
You should still safely remove/software eject SD cards/USB drives under all versions of Windows. If you aren't you're risking data loss especially after writes
 
Last edited by a moderator:
Kramy said:
Would it be possible to prompt to move the settings? Maybe link the files somehow, so moving one also moves the other?

Well, that's not possible with a normal file manager as it doesn't know anything about this.

However, if someone does code a PND-Manager which allows easy changing settings (clockspeed, etc.) for the PNDs you have, automatic updating, automatic downloading and installing, such feature could also be included.
Not hard to code such manager :)

I just don't like how ejecting things works in non-Windows OS's. I can copy a video to SD, and go off to eat lunch. I return 35 minutes later, and yank it out. Ubuntu complains about not ejecting first. When I put the card back in the card reader, I see the file I copied is completely corrupted.

That's only if the write cache is enabled (which it is as default on Linux).
It it's disabled, the copy is finished when the file transfer is done.

Windows has the write cache disabled as default, that's why you don't have issues here.

While copying without write cache doesn't do much difference with big files, it certainly does make a difference with a lot of small files.
I remember I copied a GP2X game which had tons of small files (forgot which one it was, it was later packaged up to use squashfs) and that took about 1 hour without write cache and about 10 minutes with write cache.
Huge difference.

However, of course, with cache enabled you need to wait until everything is finished.

In Windows, I tell it to copy the file - it copies minut
es faster, and then I yank it out as soon as the light stops blinking. No issues.

Hm, should be the same with Linux. As soon as my card reader stops blinking, it means that the file transfer is finished.
That's a hardware thing, so it's not affected by the write cache.
The only thing that's affected is the copy-percent bar of your file manager.

skeezix said:
ie: A pnd file will not be self-edited; any writebacks will be redirected to its appdata on the same SD instead. So if you drop a new version in, it just picks up your same save data no problem.
Even if they have different filenames?

Yes, you can rename the PNDs to anything you want.
The appdata path is defined within the PND.
That said, you can also override it if you want (i.e. if you want to try out a new version with your own settings, etc.)

Pleng said:
skeezix said:
2) You can put them any old place you want, and then just use a directory browser to find them and run them (file-associate .pnd to pnd_run and bam, good to go most of the time)
is there any reason that the OS shouldn't be shipped with this behaviour as default?

It is setup like that.
 
Last edited:
Going up a bitr .. yes, there is a place in NAND that is searched for pnd's, but its empty or not defined in all our firmware builds so far. I had intended it so that we could build some stuff into included-pnds, so that they could be launched from pnd-only aware launchers, or to get some of the pnd-magic-behaviour (ie: appdata redirection). Currently nothing included in the firmware is a pnd, but its an option we have open. (And clearly, the searchpaths for pnd files are in conf files, so trivial to fiddle with.)

Currently the appdata directory-name is the pnd's unique-id (which is encouraged to be something relatively clear like 'hatari.skeezix'), but if I get time I'll fork it so wehave both unique-id and appdata-preferred-name. I forget if we did that already or not, but I had meant to :)

Writing back into a programs dir is a Bad Idea; it is _convenient_ sometimes, but generally poor -- god help you on a multiuser system (you're thinking back to Win3.1 or WinXP and single user .. bvut if you store data right into the app-dir, and you switch users.. you're screwed right?) -- it also leads to security issues when an app writes over itself (or something else writes there ;), and means you can't generally pick up an app and copy it to somewhere else (incomplete installs). With a separate app and data dirs (every modern OS, be it app data is your homedir, an app data dir, or whatever), you have a nice clean difference. The trick with pnd files is we do it to the same SD as the pnd app is on plus all the other pnd magic (no install, etc.)

jeffphone
 
mindlord said:
The way I understand it - libPnd polls a few key places on the SD slots every few seconds.

i hope they use inotify. However, Skeezix is here to corect me / clarify that. :)

offtopic: I just leanred about fsniper (uses inotify as well) for Linux, you should check it out if oyu are runnin glinux at home.
 
Last edited by a moderator:
Back
Top