Skip to content

Instantly share code, notes, and snippets.

@DrMabuse23
Created May 29, 2014 08:20
Show Gist options
  • Save DrMabuse23/bebf322226fd5035a721 to your computer and use it in GitHub Desktop.
Save DrMabuse23/bebf322226fd5035a721 to your computer and use it in GitHub Desktop.
'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