read_bin: Read all records of a binary file as a raw vector by default

Description Usage Arguments Value Examples

View source: R/io.R

Description

This is a wrapper function of readBin() with default arguments what = "raw" and n = file.size(file), which means it will read the full content of a binary file as a raw vector by default.

Usage

1
read_bin(file, what = "raw", n = file.info(file)$size, ...)

Arguments

file, what, n, ...

Arguments to be passed to readBin().

Value

A vector returned from readBin().

Examples

1
2
3
4
f = tempfile()
cat("abc", file = f)
xfun::read_bin(f)
unlink(f)

xfun documentation built on June 16, 2021, 1:07 a.m.