If you don't need the exact amount of space available, however, you can request a file system of the size you're going to download. If there is insufficient space on the device, the request will fail with error code 10 (QUOTA EXCEEDED_ERR). In the following example, I'm requesting a HUGE file system, which is almost certainly guaranteed to fail for a few years:
window.requestFileSystem(LocalFileSystem.PERSISTENT, 1024*1024*1024*1024,
function success(fs) {
alert("Got file system" + JSON.stringify(fs));
}, function error(e) {
alert("Got error" + JSON.stringify(e));
});
// This is almost certainly going to fail with {code: 10}
I just tried it, and it works. I can't vouch that it will work everywhere or consistently or forever into the future since it doesn't look like it is exposed via the JS interface. So user beware!
On Monday, April 25, 2016 at 2:09:44 PM UTC-5, Luis Zapata wrote:
...