2014-07-10 32 views

回答

0

猜猜你需要這個。

gotLocalFileSystem : function(fileSystem){ 
      fileSystem.root.getDirectory(Android/data/com.example.example, {create: false, exclusive: false}, getRootDirSuccess, fail); 
      }, 
      getRootDirSuccess: function(dirEntry) { 

        // Get a directory reader 
        var directoryReader = dirEntry.createReader(); 

        // Get a list of all the entries in the directory 
        directoryReader.readEntries(dirReadSuccess,fail); 
       }, 

      dirReadSuccess: function(entries) { 
        if(entries.length > 0){ 
         console.log(" No of files Root Directory have : "+entries.length); 
         for (i=0; i<entries.length; i++) { 
          if(entries[i].isDirectory) { 
           var aDirName = entries[i].name; // this will give the entries name 
           console.log("Entries"+aDirName); 
          } 
         } 

        }else{ 
         console.log("Empty Root Directory "); 
         isEmptyRootDir = true; 
        } 
       } 
    } 
相關問題