Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect documentation for writing text files #61

Open
TimMoore opened this issue Dec 25, 2022 · 0 comments
Open

Incorrect documentation for writing text files #61

TimMoore opened this issue Dec 25, 2022 · 0 comments

Comments

@TimMoore
Copy link

In the documentation page titled "File Handling", it shows the following example code:

void myobject_writefile(t_myobject *x, char *filename, short path)
{
    char *buf = "write me into a file";
    long err;
    t_filehandle fh;
 
    err = path_createsysfile(filename, path, 'TEXT', &fh);
    if (err)
        return;
    err = sysfile_writetextfile(fh, &buf, TEXT_LB_NATIVE);
    sysfile_close(fh);
}

This results in an empty file. The sysfile_writetextfile function requires an allocated handle. This has been discussed a few times in the forums:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant