Skip to content
This repository has been archived by the owner on Sep 30, 2022. It is now read-only.

.txt file writing 1024 character limit #1

Open
JamesBarnesBCX opened this issue Oct 12, 2017 · 5 comments
Open

.txt file writing 1024 character limit #1

JamesBarnesBCX opened this issue Oct 12, 2017 · 5 comments

Comments

@JamesBarnesBCX
Copy link

I'm trying to save my json to a file but no matter what I try I cant get it to write across multiple line with my stringified json being limited to a single line of 1024 character length.

Append being set to true doesn't write it to a new line even when I break my string into smaller 300 character chunks and write them separately.

Appending "\r\n" also doesn't fix anything as it just makes to printer display it differently but not how it is stored.

Help would be appreciated.

@hnq90
Copy link
Owner

hnq90 commented Oct 12, 2017

@JamesBarnesBCX Did you try it on React Native iOS/Android or UWP?

@JamesBarnesBCX
Copy link
Author

I tried on Android.

@hnq90
Copy link
Owner

hnq90 commented Oct 17, 2017

@JamesBarnesBCX Thanks for the report. Actually, we have just used this library on React Native iOS and UWP. We will investigate the issue later.

@bitfabrikken
Copy link

bitfabrikken commented Dec 1, 2017

Can confirm this.
Can only write 1024 length on device running Android 5.0.2
But on Android 8.0.0, can write much more.
So seems the bug is for older Android versions.

Here's some quick test code:

        var str = "";
        for (var i=0;i<2048;i++) {
            str += "A";
        }
        await FileSystem.writeToFile("testfile.txt", str, false);
        console.log("writing string with length: "+str.length);

        var txt = await FileSystem.readFile("testfile.txt");
        console.log("read string with length: "+txt.length);

Output on Android 5.0.2:

writing string with length: 2048
read string with length: 1024

@hnq90
Copy link
Owner

hnq90 commented Dec 4, 2017

@bitfabrikken Please try this version: v0.10.12

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

No branches or pull requests

3 participants