Thanks
Manfred, but in that case how does it appear in the example externalstorage code screenshot? Has it been Photoshopped in? ;-)
Mike.
You still being fooled! The screen shot shows "root", but it NOT really the case, and the folder is NOT named root!
The fact that a folder was selected could have been:
//1/extstoreage/DCIM/stuff/a/b/c/Holiday2010/pictures/summer/
So lets say from above, we select Holiday2010 Then you going to get this:
root/Holiday2010/pictures/summer/
So, what is being said here?
If you browse though a HUGE file hierarchy and even down several folders deep?
Whatever folder you select will ALWAYS start at what you select. (and that sample code thus "assumes" your root starting point is root!
So in that screen shot, we don't even know if the person selected 5 folders deep or 10.
So, the actual file path folder you select could be a real huge long nasty folder way way deep done in a huge list of sub folders.
From YOUR software point of view?
It starts out at root, and if you ask for the path name, it will start out with root/then folder/then folder/
As a result, you always start out with root - even if its buried several folders deep. And SINCE from YOUR point of view an YOUR software? Well, it going to always start out with root regardless of where you actually started from, and what folder you selected. As a result, then you can't really get the actual path name, but only something that starts out with root. You have no idea if you actually buried 10 folders deep, but ONLY that the path name always starts with root/the next folder deep.
It is one of those "abstractions" in software. Part of this is good. (your code only ever has to deal with simple starting point called "root", and you thus just write your software to work that way).
This is the good part - you don't care where in that huge folder mess you are, and you actually don't have to care
The bad part is that you really never know what the actual FULL PATH location was selected! This forces you to write software that don't have to care about this issue.
If you need to actually "know" that actual location, then you are out of luck.
So, the screen shot is fooling you, since while the starting folder is "root", it not really root at all, and there is NOT even a folder named root!
root = the folder you selected!
You ONLY know from that selected point onwards. I sometime wonder if "root" is the best choice here for something that is not really the root. However, from your software's point of view? Root is always the starting point, and thus your software will always work assuming this idea, no matter what the folder the user actually selects. So, this can ease software development - since you always can assume you start out with that folder name.
Like on windows? Well, we "usually" assume that everything starts out on drive c:\ This is ALSO why some software if installed on drive D: will actually fail! (the developer made assumptions about the file path names and locations).
Some systems actually don't use drive letters, but some kind of "device" name. Anyway, the idea here is the actual path name should not matter nor effect how your software works. From your point of view - its just a folder. The other reason of course is the crack-down on security. On older versions of software, you could jump around and mess with darn near any folder. So, you download my app and I going to grab your contact list, or look for some folder called banking and steal all that information. So, now, they are tending to limit what folder(s) you can see + use - even those on a SD card.
So, you have to see the SD card as more as some kind of thing or device as compared to a hodge podge of folders that we all are OH SO VERY used to say due to our time spent on windows.
So, when we say you can't really get the path name? No, you can only get what the user LET you select from those folders, and it comes back as some kind of folder "thing" you selected, but it still some "thing" as opposed to a full path name.
Regards,
Albert D Kallal
Edmonton, Alberta, Canada.