Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read-only file system in iOS #26

Open
boby1975 opened this issue May 6, 2020 · 1 comment
Open

read-only file system in iOS #26

boby1975 opened this issue May 6, 2020 · 1 comment

Comments

@boby1975
Copy link

boby1975 commented May 6, 2020

Hi guys,
And I'm trying to use ios/native-xcode-node-folder sample project.
But I can't to save data to the file inside main.js

var fs = require('fs');
fs.writeFileSync('test.txt', 'Hello World!');

EROFS: read-only file system, open 'test.txt'

Does anybody know how it can be writable?
Thanks a lot

@jaimecbernardo
Copy link
Member

In the cordova and react-native plugins, there's an API for it.
On iOS, the current working directory might be the App sandbox by default or this might be accessible through homedir ( https://nodejs.org/dist/latest-v12.x/docs/api/os.html#os_os_homedir ).
The iOS app sandbox will have a Documents directory you can write too, if I recall corrrectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants