Skip to content

read-only file system in iOS #26

Description

@boby1975

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

Activity

  1. jaimecbernardo commented on May 12, 2020

    @jaimecbernardo
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions