Pandora accessing file in pnd when appdata version exists


sepulep

Member
Joined
Nov 18, 2008
Messages
367
probably I am overlooking something obvious, but what is the way to access a file on the pnd for which a version in the appdata overlay exists? or a way to remove the latter?
 
i forgot to mention: from within a running script of the pnd (so from the viewpoint of the script the file would be somewhere in $HOME)
 
$HOME for the pnd is where the pnd startupscipt sets it to. Default is its appdatadirectory.


You can access files from running pnds in /mnt/utmp/pndname while the pnd is mounted.


You cannot delete files that are originally in the pnd. Files that the pnd created can be deleted in appdata.
 
I guess the question is, as a coder can I write a PND that is able to access the files I embed in the PND even if the user overrides them through the cunning use of appdata files.


I don't know of a way, and it sounds rather like you're trying to subvert the intent of the pnd mount/appdata system, so I'd like to understand better why you feel you need to do this. Pandora and its software is designed to be open and hackable. There are ways you could code your PND to make it harder for users to override them, but I can't think of a reason you'd want to.
 
Of course you can.


Rename the file in your pnd and copy it to the right place in the startupscript.


The original file will be copied every run and so will overwrite the file at every startup with the original file.


The user will only be able to modify that file while the pnd is running. On next start it will be overwritten again.


Of course the user still can use a startupscipt he modified not to copy that file if he really wants to.


That could only be circumvented by doing the copy command in the binary.


So it would help if you could tell us what you intend to do here.
 
Last edited by a moderator:
That assumes that the user would only change the working copy, but not the original.   If the user overloads the file the PND is copying from,  it will copy the user modified version every time.     

- Neelix
 
the problem is with youtube-dl in The Tube: it is setup such that the user can let youtube-dl update itself - only sometimes it breaks and I would like an option in the script to revert to the pnd version...right now I make a copy when updating (its not big) and copy it back when user wants to restore. this gets tricky when you update the pnd - presumably you would want to update to the current pnd version (and not to a previous copy)... 
 
So you could do it like this:


In every new pnd version make this file with the attached version number for example:


configfile_0.1.2.cfg


Then copy this over the current one on demand in the startupscript.


cp configfile_0.1.2.cfg configfile.cfg


Does that make sense?
 
Last edited by a moderator:
So you could do it like this:


In every new pnd version make this file with the attached version number for example:


configfile_0.1.2.cfg


Then copy this over the current one on demand in the startupscript.


cp configfile_0.1.2.cfg configfile.cfg


Does that make sense?
ok, thanks..something like this would work..
 
Back
Top