next node: FileConv,
prev node: UserAndGroup,
up to node: Subsystem Unix


BinFile

Signature of BinFile

List of Import References :
See BOOL
See Char
See Com
See DENOTATION
See File
See Int
See Nat
See Option
See Seq
See String
See Void

SIGNATURE BinFile[data]

$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)

-- low-level binary file I/O of (nearly) arbitrary data objects 

SORT data

IMPORT  Void            ONLY void            
        Com[void]       ONLY com
        Com[data]       ONLY com ans
        File            ONLY file

FUN write : file ** denotation ** data -> com[void]
    -- write data to output, tagging it with denotation

FUN read : file ** denotation -> com[data]
    -- read data from input which was written with given tag

FUN tagMismatches? : ans[data] -> bool
    -- check for failure because of tag mismatch on read

FUN invalidFormat? : ans[data] -> bool
    -- check for failure because of invalid format on read

FUN cannotLinkFun?    : ans[data] -> bool
    -- check for failure of runtime linkage of a function 

/* NB. Strong typing is violated by this functions. The user
       is responsible to perform type checks using the supplied
       string tags.

       A tag mismatch error has the format
       "binary IO tag mismatches, found '%%', expected '&&'"
       %% is the tag found in the file,
       && is the tag given in the call of read,
       both contain also the internal tag

       On some systems binary IO objects may contain functions;
       a functions code is dynamically linked to the running process.
       See system dependend documentation.
*/


next node: FileConv,
prev node: UserAndGroup,
up to node: Subsystem Unix