Comments (2)
I found the following:
awesome-cordova-plugins/src/@awesome-cordova-plugins/plugins/file/index.ts
Lines 1053 to 1056 in bddafc7
awesome-cordova-plugins/src/@awesome-cordova-plugins/plugins/file/index.ts
Lines 111 to 122 in bddafc7
Original source of the plugin:
create - file or directory if it doesn't exist
exclusive - used with create; if true the command will fail if target path exists
Following the code of this repo further to writeFileEntry. This means. You don't need replace
here, just append
. The option replace
will just throw an error if the file already exist. But please correct me if I'm wrong. In my case:
log(message, replace = false) {
this.file.writeFile(path, fileName, message, { append: !replace, replace: true } );
}
But this does not work as expected. There is no option combination to log append or not to a file regardless if existing or not. You either get an error if the file already exists or get an error if the file does not already exists. It's a mess! With append true and replace true I get an error, when the file does not exist. Yes, because create = !append. But this forces me to know, if the file already exists or not. It's really not good implemented. The following does also not work.
const fileExists = await this.file.checkFile(path, fileName);
await this.file.writeFile(path, fileName, message, { append: fileExists });
I mean in background is create = !append
. Means if fileExists == true
, then create = false
. And replace
(exclusive
behind) has no effect, when create == false
. It should just open the file and log. If fileExists == false
, then create = true
, but fails on it and throws error file not exists NOT_FOUND_ERR
. Regardless of replace
. Any idea?
Update: checkFile
does not work. It rejects instead of resolve boolean. Ref. #4689 So there are really some lacks in types, docs and code.
from awesome-cordova-plugins.
There has been no recent activity and this issue has been marked inactive.
from awesome-cordova-plugins.
Related Issues (20)
- Screen orientation plugin don't lock screen on ios 17 HOT 1
- Where to find real documentations? HOT 1
- Plugin bluetooth-le>RespondParams Interface> Missing optional property: address HOT 1
- download PDF file from external website with inappbrowser HOT 1
- Avoid `any` type and use tsdoc comment properly. HOT 1
- [BLE] Missing method `requestConnectionPriority`. HOT 1
- Creating Cordova Plugin HOT 1
- Add interface to diagnostic plugin HOT 1
- @awesome-cordova-plugins/local-notifications: getAllScheduled and getAllTriggered not working in Cordova HOT 1
- Is there any Unity3D plugin? HOT 1
- Plugin for Google Nearby Connections HOT 1
- social-sharing :: not working on onePlus device when share mp4 video. HOT 1
- Exception calling Diagnostic.requestBluetoothAuthorization method HOT 1
- Cannot find plugin.xml
- requestConnectionPriority() is missing in BLE plugin HOT 1
- @awesome-cordova-plugins/media seems not to work at all HOT 1
- @ionic-native/in-app-purchase-2 isnt compatible with billingclient v5 as required by Google to update apps HOT 1
- Where is @ionic-native/sqlite in awesome-cordova-plugins? HOT 2
- Can you add cordova-plugin-autostart please HOT 1
- in-app-browser: actually support browser platform HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-cordova-plugins.