Answers for "read from binary file"

PHP
3

read binary file python

file = open("sample.bin", "rb")
binary_data = file. read()
Posted by: Guest on April-15-2021
7

write a binary file c

FILE *write_ptr;

write_ptr = fopen("test.bin","wb");  // w for write, b for binary

fwrite(buffer,sizeof(buffer),1,write_ptr); // write 10 bytes from our buffer
Posted by: Guest on May-15-2020
0

reading binary file

with open("myfile", "rb") as f:
    byte = f.read(1)
    while byte != b"":
        # Do stuff with byte.
        byte = f.read(1)
Posted by: Guest on April-18-2021

Browse Popular Code Answers by Language