# Writing to file IOS

**URL:** <https://discourse.libsdl.org/t/writing-to-file-ios/18586>\
**Category:** SDL Development\
**Created:** [November 16, 2011, 9:06am UTC](https://discourse.libsdl.org/t/writing-to-file-ios/18586 "2011-11-16T09:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cory\_mcm](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/c/5daacb/32.png) [@cory\_mcm](https://discourse.libsdl.org/u/cory_mcm)\
**Post date:** [November 16, 2011, 9:06am UTC](https://discourse.libsdl.org/t/writing-to-file-ios/18586/1 "2011-11-16T09:06:35Z")

</div>

Im using SDL 1.3 and for my new game I want to have a save game. I would only write out what level the user is on. Just wondering if any one has done this before. I was thinking about using fwrite or try to create a obj c function that will write to a plist in the home directory. Let me know if you have tried this before or know how to do it because some things in ios just stump me.

---

<div class="post-metadata">

**Author:** ![Gabriele\_Greco](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/8edcca/32.png) [@Gabriele\_Greco](https://discourse.libsdl.org/u/Gabriele_Greco)\
**Post date:** [November 16, 2011, 9:14am UTC](https://discourse.libsdl.org/t/writing-to-file-ios/18586/2 "2011-11-16T09:14:51Z")

</div>

> \*\*  
> Im using SDL 1.3 and for my new game I want to have a save game. I would  
> only write out what level the user is on. Just wondering if any one has  
> done this before. I was thinking about using fwrite or try to create a obj  
> c function that will write to a plist in the home directory. Let me know if  
> you have tried this before or know how to do it because some things in ios  
> just stump me.

I use fopen/fwrite and write my savegames to “…/Documents/”, it works but  
I’m not sure it’s the correct way to do it :)On Wed, Nov 16, 2011 at 10:06 AM, cory\_mcm \<cory\_mcm at [hotmail.com](http://hotmail.com)\> wrote:

–  
Bye,  
Gabry

---

<div class="post-metadata">

**Author:** ![cory\_mcm](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/c/5daacb/32.png) [@cory\_mcm](https://discourse.libsdl.org/u/cory_mcm)\
**Post date:** [November 16, 2011, 9:26am UTC](https://discourse.libsdl.org/t/writing-to-file-ios/18586/3 "2011-11-16T09:26:22Z")

</div>

Thanks for the fast reply. That sounds like the way I was going to do it, IOS 5 has some weird restrictions about writing to the cache directory and documents directory. Ill try the c++ fwrite and fread and ill post back when I summit to the app store on if they allow that.
