Function to open a binary file
The BINOPEN() function opens an existing binary file. The <expC> is the name of the file to be opened. The <expN> is the mode in which the file will be opened. The open mode options are:
BINOPEN() returns a file descriptor if it has opened the file successfully, or a -1 if unsuccessful. Since the file descriptor is used to identify open binary files, the BINOPEN() return value should always be assigned to a memory variable. The binary conversion functions may be used in conjunction with the binary file functions.
fd = binopen("file.obj", 2) count = binread(fd, 4) count = bin2l(count) count = l2bin(count + 1) binseek(fd, 512, 0) binwrite(fd, count) binclose(fd)