BINWRITE(integer-handle, integer-buffer, integer-length)
Writes binary data from memory to an open file.
- integer-handle — file handle from OPENOUT or OPENUP.
- integer-buffer — source memory handle/pointer (from MEMALLOC or other).
- integer-length — number of bytes to write.
Examples
fh = OPENOUT("copy.bin")
buf = MEMALLOC(1024)
REM ... fill buf with data ...
BINWRITE fh, buf, 1024
CLOSE fh
MEMRELEASE buf
Notes
- Binary-safe; writes bytes exactly as stored in memory.
- Ensure the file was opened with appropriate mode (OPENOUT to create/overwrite, OPENUP to update).
See also: OPENOUT · OPENUP · MEMALLOC · MEMRELEASE