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

View source: R/io.R

read_binR Documentation

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

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

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

f = tempfile()
cat("abc", file = f)
xfun::read_bin(f)
unlink(f)

yihui/xfun documentation built on April 29, 2024, 12:16 p.m.