Project

General

Profile

Bread » History » Revision 2

Revision 1 (Per Amundsen, 02/08/2014 11:31 PM) → Revision 2/8 (Per Amundsen, 02/08/2014 11:31 PM)

_Added in 1.9.0_ 

 */bread -t <filename> <S> <N> <&binvar>* 

 Reads <N> bytes starting at byte position <S> in the file and stores the result in &binvar. 

 *Switches* 

 -t - reads data until the next CR/LF or EOF. 

 *Parameters* 

 <filename> - The binary file to read. 
 <S> - The position in the file to start reading from. 
 <N> - Number of bytes to read. 
 <&binvar> - The &binvar to read the data into. 

 *Example* 

 <pre> 
 ;noop $example(FileA, FileB) 
 alias example { 
    ;Read the whole file into a binary variable 
    bread $qt($1) 0 $file($1).size &tempFile 
 
    ;Write the bytes form the binary variable to a file 
    bwrite $qt($2) 0 -1 &tempFile 
 } 
 </pre>