I am executing the following code in a Tizen web app I'm working on
tizen.filesystem.resolve('.',
function (dir) {
dir.listFiles(
function (files) {
for (var i = 0; i < files.length; ++i)
console.log('File : ' + files[i].name + '\nURL : ' + files[i].toURI() + '\n========');
} )
},
function (err) { console.log('Error : ' + err.message); window.__error = err },
'r')
... and I am getting the following in the console
null
VM569:10 Error : The content of an object does not include valid values.
My question is , what's wrong with the code snippet above ? How am I supposed to invoke the Tizen filesystem API ?
Thanks in advance .
Above, you are trying to resolve
.
(root?) support for which is not required and probably you don't have an access to it.This also confirms my observation, from the docs:
Try to use one of the supported locations:
See an example code from API ref. site:
see, below FileSystem Tutorial and API Reference
FileSystem Tutorial https://developer.tizen.org/development/tutorials/web-application/tizen-features/base/filesystem#retrieve
Filesystem API Reference https://developer.tizen.org/dev-guide/latest/org.tizen.web.apireference/html/device_api/mobile/tizen/filesystem.html#FileSystemManager::resolve
If you put your text file on /project_root/data/text/x.txt. You can access to that file with "wgt-package/data/text/x.txt" path on webapi.
So below is simple example code. try it.