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 :)
It looks like you're new here. If you want to get involved, click one of these buttons!