Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary file write
#6
It's not that difficult.

Code: (Select All)
DIM ff AS LONG
$IF WIN THEN
DIM CRLF AS STRING * 2
CRLF = CHR$(13) + CHR$(10)
$ELSEIF LINUX THEN
DIM CRLF AS STRING * 1
CRLF = CHR$(10)
$ELSE 'it's... grymmjack's computer! Isn't it? (scratch head)
DIM CRLF AS STRING * 1
CRLF = CHR$(13)
$END IF

ff = FREEFILE
OPEN "blah.bin" FOR BINARY AS ff
PUT #1, , CRLF
CLOSE ff

Or could check result of `_OS$()` function. For an executable it doesn't matter because the three main operating systems use different formats: Linux uses ELF.
Reply


Messages In This Thread
Binary file write - by eoredson - 09-23-2023, 02:44 AM
RE: Binary file write - by mnrvovrfc - 09-23-2023, 03:14 AM
RE: Binary file write - by eoredson - 09-23-2023, 03:57 AM
RE: Binary file write - by bplus - 09-23-2023, 07:12 PM
RE: Binary file write - by bplus - 09-23-2023, 06:56 PM
RE: Binary file write - by mnrvovrfc - 09-23-2023, 11:04 PM
RE: Binary file write - by eoredson - 09-24-2023, 01:26 AM
RE: Binary file write - by SMcNeill - 09-24-2023, 01:29 AM
RE: Binary file write - by SpriggsySpriggs - 09-25-2023, 11:30 AM
RE: Binary file write - by eoredson - 09-26-2023, 02:25 AM



Users browsing this thread: 2 Guest(s)