swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
modifier  

binary-mode

 
 

Syntax

with binary-mode (& open-modifier)*

or 

binary-mode (buffered | unbuffered)? data-source


Purpose

Causes data to be written to the file in "binary mode". This means that no translation is done to newline characters; each character is written "as is" to the file.

This modifier is effective only on streams attached to files.

The following code reads the contents of the binary file "source.txt" into a buffer attached to "raw-text":

  local stream raw-text
  
  set raw-text to binary-mode file "source.txt"

In the following code, the binary-mode declaration is used to specify that stream "f" contains binary rather than text data.

  declare #main-output has binary-mode
  
  process
     local stream f
     ...
     open f with binary-mode as file "f.txt"

binary-mode is the default input mode for UNIX platforms. Non-UNIX platforms use text-mode as the default input mode.

    Related Syntax
   text-mode
   buffered, unbuffered
 
Related Concepts
   Buffering I/O
   Files: binary-mode and text-mode
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.