{Spam?} writing binary files

larcky <[email protected]> Mon, 1 May 2017 02:52:03 -0700 (MST)
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
Hello
Is Pike able to write binary files?  Something like this in C:

#include <stdio.h>
int main()
{
    int n = 7;
    int arr[] = { 4, 5, 9, 12, 255, 0, 8 };
    FILE *fout = fopen("foo.bin", "wctb");

    for (int i = 0; i < n; ++i) {
        fwrite(arr+i, 1, 1, fout);
    } 
    fclose(fout);
    return 0;
}

Thanks.





--
View this message in context: http://pike.1058338.n5.nabble.com/writing-binary-files-tp5713245.html
Sent from the Pike - User mailing list archive at Nabble.com.