Returns the size in bytes of an LPJmL file header based on a header list object read by read_header() or generated by create_header().

get_headersize(header)

Arguments

header

Header list object as returned by read_header() or create_header().

Value

Integer value giving the size of the header in bytes. This can be used when seeking in the file or to calculate the expected total file size in combination with the number of included data values and the data type.

See also

Examples

if (FALSE) {
header <- read_header("filename.clm")
size <- get_headersize(header)
# Open file for reading
fp <- file("filename.clm", "rb")
# Skip over file header
seek(fp, size)
# Add code to read data from file
}