I'm creating a Chrome application. I must read the files of a directory and I am using the DirectoryEntry API and DirectoryReader API.
My problem is that the maximum files read using DirectoryReader#readEntries is 100, the first 100 (alphabetical order)
var reader = currentDir.createReader();
var read = reader.readEntries.bind(reader, function(files) {
for ( var i = 0; i < files.length; i++){
if (files[i].name == nameSearches){
callback(files[i]);
}
}
})
callback(undefined)
}
read();
The value of files.length
is 100
and there are more files in the directory
I'm not sure if this limitation is about Google Chrome, Google Chrome Applications, Javascript... and if this limitation can be overcomed
With the solution marked the result code is this:
var reader = currentDir.createReader();
var read = reader.readEntries.bind(reader, function(files) {
if (files.lenght == 0) {
callback(undefined);
}
for ( var i = 0; i < files.length; i++){
if (files[i].name == nameSearches){
callback(files[i]);
}
}
})
read();
}
read();