Here they are. They prompt for the file name using [openpanel] and [savepanel]. I'm not sure if that's what you really want. But it shouldn't be difficult to modify them to pass a file name through an inlet, or just hard-code the file name. They're built on top of Martin Peach's [binfile], which is included in pd-extended. But if you're using vanilla pd, you'll have to download Martin's code as well.
To use 'getfile', just send it a 'bang' and it will return a list of floats containing the byte values in the file. To use 'putfile', just send it a list of floats. It doesn't do any validation, so if the list contains a non-integer or an integer that's outside the range of 0 to 255, you'll get one of the following errors, for example:
error: binfile: input (7.300000) not an integer error: binfile: input (100020) out of range [0..255]
David.
On Tue, Mar 8, 2011 at 1:37 PM, Jamie Bullock jamie@postlude.co.uk wrote:
On 8 Mar 2011, at 17:55, David dfkettle@gmail.com wrote:
Hi! I developed some abstractions for reading/writing binary files, but they're somewhat limited in capability. They just load the data into a list of floats (one per byte), or save a list of floats to a file, and they read/write the entire file at once. They don't support repositioning within the file, or writing/reading a portion of the file. But if the files are relatively small, they might be suitable.
I can send them to you later if you're interested, I'm at work right now.
Thanks, that would be great!
Jamie