I'm trying to make a dynamic interface for interacting with the HTML5 filesystem in Chrome Canary, but I am currently hitting a stumbling block.
I use
dirReader.readEntries(function (entries) {
if (!entries.length){
return;
}
for (var i = 0 ; i < entries.length; i++){
$scope.files.push(entries[i]);
}
dirReader.readEntries();
}, errorHandler);
to get them the first time, which works fine. But if I create a new file, and run the code again, it returns nothing.
I imagine it is using an old reference to the file system or something like that, so I imagine I need to reinitialize the file system or the directory reader (That's a guess)? What is the best way to deal with that issue?
Edit: Getting a new reference to the file system does work, but that makes me vomit a little. A better way to do that would still be excellent.