Not sure if it's by design or needed somewhere but when you print out the media that is returned by the camera you'll find folder/file structure from your app up to the root folder:
The output from the above code on my phone will be:
{
"height": 2368,
"type": 1,
"mimeType": "image/jpeg",
"text": null,
"nativePath": "file:///storage/emulated/0/Android/data/com.miga.testcamera/cache/_tmp/tia737439898.jpg",
"width": 4208,
"length": 2104961,
"file": {
"writable": true,
"executable": false,
"nativePath": "file:///storage/emulated/0/Android/data/com.miga.testcamera/cache/_tmp/tia737439898.jpg",
"name": "tia737439898.jpg",
"symbolicLink": false,
"size": 2104961,
"directoryListing": null,
"hidden": false,
"readonly": false,
"parent": {
"writable": true,
"executable": false,
"nativePath": "file:///storage/emulated/0/Android/data/com.miga.testcamera/cache/_tmp",
"name": "_tmp",
"symbolicLink": false,
"size": 4096,
"directoryListing": ["tia737439898.jpg", "remote-cache"],
"hidden": false,
"readonly": false,
"parent": {
"writable": true,
"executable": false,
"nativePath": "file:///storage/emulated/0/Android/data/com.miga.testcamera/cache",
"name": "cache",
"symbolicLink": false,
"size": 4096,
"directoryListing": ["_tmp"],
"hidden": false,
"readonly": false,
"parent": {
"writable": true,
"executable": false,
"nativePath": "file:///storage/emulated/0/Android/data/com.miga.testcamera",
"name": "com.miga.testcamera",
"symbolicLink": false,
"size": 4096,
"directoryListing": ["cache", "files"],
"hidden": false,
"readonly": false,
"parent": {
"writable": true,
"executable": false,
"nativePath": "file:///storage/emulated/0/Android/data",
the next output will be all my folders on the SD card, then it will go up and show a warning
since it's not rooted and can't access all the folders. So depending on your structure and the amount of folders you have the output will be very large.
It should stop at the app level if the information is not needed in any other place.
Sure on android you can change the folder via code but the JSON output is cut of because it's too big and that is not needed in this case I think.
[~michael], this issue was resolved in Titanium 8.0.0. We removed the "directoryListing" property from the
Ti.Filesystem.File
object. It's now a method instead that. So, doing a stringify on the object will no longer output the directory listing anymore. https://github.com/appcelerator/titanium_mobile/commit/39c330fc2d8730dcd31d5976f298289f963c2c57#diff-270689a7e55b3ec8920d9cfec7c0846aYes, the directoryListing is gone but output with 8.0.1.GA is still
The parent still goes up to file/// and leaving the app folder. The question is if that is necessary at all.
Oh... you're right. It sounds like we need to set up the "parent" property as *not* enumerable.