1

I'm toying with the notion of building an iOS app powered by a Rust library. I want this app to use the Files App for storing plain text files that my app will manipulate, but I don't know if my Rust library can read the files stored there directly or if they need to be read into memory first by my Swift code and passed in as arguments when invoking my Rust library through FFI.

I'm still learning both Swift & Rust, so I haven't gotten a workable prototype built yet (thus no code to share), but I want my Rust library to be able to

  1. Read directory and file contents (presumably the sandboxed Documents directory available to my iOS app)
  2. Write updates to the same files.

Is this possible? If so, how might it look?

neezer
  • 19,720
  • 33
  • 121
  • 220
  • I don't see why not. What is the approach for other languages?. If C, C++ or Objective-C can, Rust should be ok to go too. – Netwave Feb 03 '21 at 10:12
  • @Netwave I suppose the question isn't Rust-specific; can libraries invoked via FFI interact with the iOS sandboxed filesystem directly? I don't know enough about the iOS SDK and the Files API to be able to answer that question myself, thus the post. – neezer Feb 03 '21 at 15:34
  • yeah, I'm not expert neither, I had no problems in android native before. If the path is available it should have no issues. – Netwave Feb 03 '21 at 15:43

0 Answers0