Bread » History » Version 1
Per Amundsen, 02/08/2014 11:31 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | */bread -t <filename> <S> <N> <&binvar>* |
||
4 | |||
5 | Reads <N> bytes starting at byte position <S> in the file and stores the result in &binvar. |
||
6 | |||
7 | *Switches* |
||
8 | |||
9 | -t - reads data until the next CR/LF or EOF. |
||
10 | |||
11 | *Parameters* |
||
12 | |||
13 | <filename> - The binary file to read. |
||
14 | <S> - The position in the file to start reading from. |
||
15 | <N> - Number of bytes to read. |
||
16 | <&binvar> - The &binvar to read the data into. |
||
17 | |||
18 | *Example* |
||
19 | |||
20 | ;noop $example(FileA, FileB) |
||
21 | alias example { |
||
22 | ;Read the whole file into a binary variable |
||
23 | bread $qt($1) 0 $file($1).size &tempFile |
||
24 | |||
25 | ;Write the bytes form the binary variable to a file |
||
26 | bwrite $qt($2) 0 -1 &tempFile |
||
27 | } |