I am trying to understand the reading and writing portions of the SDK and am having trouble with the sysfile_write(). I got sysfile_writetextfile() to work but am stuck with this.
I followed the documentation but the resulting textfile, while 100 bytes large, is empty. Here is the code:
void buffTest_writefile(t_buffTest *x, char *filename, short path)
{
char *buf[100];
t_fourcc filetype = 'TEXT';
t_ptr_size count;
long err;
t_filehandle fh;
for (int i = 0; i < 100; i++) {
buf[i] = i + 1;
}
count = 100;
err = path_createsysfile(filename, path, filetype, &fh);
if (err)
return;
err = sysfile_write(fh, &count, buf);
sysfile_close(fh);
}
Any pointers would be appreciated ;)
Max 6.1.3
SDK. 6.1.1
OSX 10.8.4