Created
May 29, 2014 08:20
-
-
Save DrMabuse23/bebf322226fd5035a721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('app') | |
.controller('FilemanagerCtrl', function ($scope) { | |
var rootPath = null; | |
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail); | |
function onFileSystemSuccess(fileSystem) { | |
console.log(fileSystem.name); | |
console.log(fileSystem.root.name); | |
console.log('fullPath',fileSystem.root.fullPath); | |
rootPath = fileSystem.root.fullPath; | |
// console.log(['dieEntry',dirEntry]); | |
function success(entries) { | |
for (i = 0; i < entries.length; i++) { | |
console.log(entries[i].name); | |
} | |
// console.log(i); | |
} | |
function fail(error) { | |
alert("Failed to list directory contents: " + error.code); | |
} | |
// Get a directory reader | |
var directoryReader = fileSystem.root.createReader(); | |
// Get a list of all the entries in the directory | |
directoryReader.readEntries(success, fail); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment