Description Usage Arguments Details Value Author(s) See Also Examples
Read the raw binary content of a file using a description of the binary format.
1 2 |
file |
The name of a file or a connection. |
format |
A |
width |
The number of bytes to print per row when displaying the file. |
offset |
An offset within the file to start reading. |
machine |
How to print each byte when displaying the file; either
|
flatten |
If |
This function uses a "memFormat"
description to
read the raw binary content of a file and interpret
sub-blocks of the file as distinct (blocks of) values.
The "memFormat"
can described a nested structure of
blocks. The flatten
argument is used to convert
nested format structures to a flat (depth of one) structure.
The format is always flattened for display, but extracting
A "rawFormat"
object, which is a list:
blocks |
A list (of lists) of |
offset |
The offset in the file where reading began. |
nbytes |
The number of bytes read from the file. |
Paul Murrell
viewFormat
memFormat
as.character.rawFormat
print.rawFormat
readRaw
readBin
1 2 3 4 5 6 7 | fileFormat <- readFormat(hexViewFile("rawTest.int"),
memFormat(int1=integer4, int2=integer4))
blockValue(fileFormat$blocks$int2)
fileFormat <- readFormat(hexViewFile("rawTest.int"),
memFormat(integers=vectorBlock(integer4, 20)))
blockValue(fileFormat$blocks$integers)
|
[1] 2
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.