Q-enabled File interface for Cordova
npm install qordova-fileA Q-enabled filesystem wrapper for Cordova. Easier to use than cordova-plugin-file.
cordova plugin add cordova-plugin-file
npm install quordova-file
Check to see if a file exists.
``deviceready
// Note that we must wrap inside because it uses Cordova features.`
document.addEventListener("deviceready", (function() {
File.exists(fname)
.then(function() {
console.log('exists');
})
.fail(function() {
console.log('does not exist');
});
}), false);
Remove a file or recursively remove a directory.
`deviceready
// Note that we must wrap inside because it uses Cordova features.``
document.addEventListener("deviceready", (function() {
File.rm(fname)
.then(function() {
console.log('file or directory deleted, or didn't exist in the first place');
})
.fail(function(FileError) {
console.log('could not delete file or directory', err);
});
}), false);