![]() |
2009-02-21
, 04:14
|
|
Posts: 296 |
Thanked: 80 times |
Joined on Dec 2007
|
#2
|
The Following User Says Thank You to ace For This Useful Post: | ||
![]() |
2009-02-21
, 11:39
|
|
Posts: 696 |
Thanked: 1,012 times |
Joined on Mar 2006
@ Asturies, Spain
|
#3
|
import os os.path.expanduser("~")
The Following User Says Thank You to yerga For This Useful Post: | ||
![]() |
2009-02-21
, 14:01
|
|
Posts: 273 |
Thanked: 104 times |
Joined on Mar 2007
@ Manitoba, Canada
|
#4
|
![]() |
2009-02-21
, 15:17
|
Posts: 39 |
Thanked: 13 times |
Joined on Apr 2008
@ Genoa, Italy
|
#5
|
It occurred to me that when I wrote 'Mephemeris', that I made sure that '/usr/lib/mephemeris' had done a 'chmod 777' on the directory, to insure that the 'user' had full access to write files there (for the downloaded image pics, which overwrote each other so as not to accumulate).
I guess I am still wondering if this is 'wrong' in the Maemo world or not?
![]() |
2009-02-21
, 17:42
|
Posts: 2,102 |
Thanked: 1,309 times |
Joined on Sep 2006
|
#6
|
![]() |
2009-02-21
, 19:16
|
|
Posts: 273 |
Thanked: 104 times |
Joined on Mar 2007
@ Manitoba, Canada
|
#7
|
![]() |
2009-02-21
, 19:26
|
|
Posts: 903 |
Thanked: 632 times |
Joined on Apr 2008
|
#8
|
Yerga, this is definitely a good tip, but how can one 'anticipate' which user will be running the app, so that the app install can pre-create the app subdirectory in '/home/xxxusername/.appname'?
Or do you intend to also change your app to 'create' the necessary '.appname' subdirectory if it doesn't exist?
if not os.path.exists(path_here): <statements here>
The Following User Says Thank You to BrentDC For This Useful Post: | ||
![]() |
2009-02-21
, 19:39
|
|
Posts: 273 |
Thanked: 104 times |
Joined on Mar 2007
@ Manitoba, Canada
|
#9
|
if not os.path.exists("~/.appname"): os.system('mkdir -p ~/.appname')
I had intended to allow the user to save to the directory containing my actual app (i.e. /usr/lib/appname) -- but my program (and any others that attempt to do the same thing?) silently fail when a 'save' is attempted to a directory like that -- presumably since only 'root' has write access to most of the file system.
So...is the 'official' spot for apps to save data supposed to be '/home/user'? Or, to keep data separate, '/home/user/appname'? I suppose that the user then has the ability to make this a logical link to, say, one of the '/media' (card) locations? If so, then there is not much point is writing an app that lets the person navigate all over the file system for files to read/write -- and should instead 'hardcode' this to '/home/user/appname'?
Thanks for any feedback! My silly app is stalled out due to this issue
There is nothing more dangerous than a bored cat.