Skip to content

fix:修复writeStream方法在流式写入时写入内容替换了原本内容问题 #28

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

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

WN0904
Copy link

@WN0904 WN0904 commented Sep 14, 2024

Summary

  • closes writeStream方法在流式写入时写入内容替换了原本内容 #25
  • 修复writeStream方法在流式写入时写入内容替换了原本内容
  • fs.createStreamSync(filePath, mode) 当mode为”a+“时 a+:以附加方式打开可读写的文件。若文件不存在,则会建立该文件,如果文件存在,写入的数据会被加到文件尾后,即文件原先的内容会被保留。

Test Plan

  const writeStream = () => {

    ReactNativeBlobUtil.fs.writeStream(
      text + "/test.txt",
      'utf8',
      true
    )
    .then((ofstream) => {
      ofstream.write('foo')
      ofstream.write('bar')
      return ofstream.close()
     
  })
)

Checklist

  • 已经在真机设备或模拟器上测试通过
  • 已经与 Android 或 iOS 平台做过效果/功能对比
  • 已经添加了对应 API 的测试用例(如需要)
  • 已经更新了文档(如需要)
  • 更新了 JS/TS 代码 (如有)

@xbh0902 xbh0902 merged commit 8d81769 into react-native-oh-library:sig Sep 14, 2024
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

Successfully merging this pull request may close these issues.

writeStream方法在流式写入时写入内容替换了原本内容
2 participants