Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

read_bin

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)

xfun

Miscellaneous Functions to Support Packages Maintained by 'Yihui Xie'

v0.22
MIT + file LICENSE
Authors
Yihui Xie [aut, cre, cph] (<https://orcid.org/0000-0003-0645-5666>), Wush Wu [ctb], Daijiang Li [ctb], Xianying Tan [ctb], Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>), Christophe Dervieux [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.