언어 설정

Menu
Sites
Language
how to retreive all directories in phone.

Hi,

i can't get all directories in phone.If i use file system api then i'm getting only virtual drive(documents,images,videos etc).If I use 

getDirectories() of content API then it shows the end point directories.Moreover it can't retrieve some directories in phone

suppose media has SMemo,Sounds,documents,videos,images,Abc,Def,GHe  etc folders.

i am getting only videos,images documents etc these basic folders and Abc,Def,GHe these folders are not shown.

I am going to make a file manager app.That's why i need it.

How to get all folders in a phone?.

Responses

5 댓글
AVSukhov

Hello,

You can not do this using the Web API.

You can ask a similar question on Native forum.

Alex Dem

just fyi:
Regarding Native apps you could take a look onto  NativeApp->FileManager Sample application.
This example could be useful but it shows the same virtual dirs.
https://developer.tizen.org/dev-guide/2.3.0/org.tizen.mobile.native.appprogramming/html/sample_descriptions/file_manager_sd.htm
Alexey.

Alex Dem

Hi,
just fyi: using Storage api (native) I was able to get only root and media directories for storages too.
Alexey.

colin Rao

Is it a privilege issue. Maybe need to root the device. Some system folders are not allowed to be modified as generally.

Alex Dem

Hi,
I have checked Web Device API (using Web app example) this way,
here is my code snippet:

...
//don't forget to add "http://tizen.org/privilege/filesystem.read"
...

    function onListFilesSuccess(files)
    {
       for (var i = 0; i < files.length; i++)
       {
          /* Display the file name and URL */
         alert("File name is " + files[i].name + "and URL is " + files[i].toURI());
       }
    }
    function onListFilesError(err)
    {
       alert("onListFilesError "+err.message);
    }
    
    
    function onResolveSuccess(dir)
    {
       alert("onResolveSuccess");
       dir.listFiles(onListFilesSuccess, onListFilesError);
    }

    function onResolveError()
    {
       alert("onResolveError");
    }
    
    tizen.filesystem.resolve('/opt/usr/', onResolveSuccess, onResolveError, 'r');

I was able to get (on Kiran device) list of directories and files of /opt/usr/ folder but for /opt/ I have got error message:

'Error while reading directory'. The same for the root folder '/' .

Alexey.