Apologies for spam; we've changed our policy by requiring approval for accounts, and deleted all existing spam and user - thanks for your help flagging content. We continue to test our forums and Vanilla software, aiming for release early in 2013. If you need to give us feedback outside the forum, contact us via http://createdigitalmusic.com/contact/ or on Facebook
How to write a text file in libpd.
  • Hi, I would like to know if it is possible to write a text file using [textfile] object in libpd. It works fine when I try to write and read a text file in normal pd. But in libpd, it does not create a text file even when using the same patch. I wonder if there's anyway to write a text file in libpd. I'm using Xcode for iOS app development by the way.

  • Quick reality check: Do you really need to write files from Pd itself, or can you handle file I/O in ObjC instead? With libpd, it usually makes more sense to use Pd for audio only and to do everything else in ObjC.

    That said, the [textfile] object should work just fine. If it doesn't, then you probably got the path wrong.

  • Hey Peter! I know nothing about ObjC. that's why I'm trying to do everything in pd except for GUI. I didn't use path for [textfile] object, I just sent [write foo.txt( message box to it. It creates foo.txt file in the same folder when I do it in normal pd. But it doesn't seem to work in libpd. Please help.

  • Hey Peter! I found out it works when I write specific path to the message box.

    But I wonder what path should I use if I'm trying to make an iOS app.

    Is there any readable, absolute path that iOS device will likely to recognize?

  • Check out this document: http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html

    You want Application_Home/Documents/ or Application_Home/tmp/, depending on how long you want to keep your files.

  • Thank you so much Peter! I finally made it using relative path in pd. [write ../Documents/foo.txt( And it works!! Thank you :)