Convert Files to and from Binary Objects (BLOBs)

Converts files to and from flobs. A flob is a file that was read into binary in integer-mode as little endian, saved as the single element of a named list (where the name is the name of the original file) and then serialized before being coerced into a blob. Flobs are useful for writing and reading files to and from databases.


flobr

Lifecycle:stable R-CMD-check Coveragestatus License:MIT CRANstatus CRAN Downloads

Introduction

flobr is an R package to convert files to and from flobs.

A flob is a file that was read into binary in integer-mode as little endian, saved as the single element of a named list (where the name is the name of the original file including its extension) and then serialized before being coerced into a blob.

Flobs are useful for writing and reading files to and from databases.

Demonstration

library(flobr)

path <- system.file("extdata", "flobr.pdf", package = "flobr")

flob <- flob(path)
str(flob)
#> List of 1
#>  $ /Library/Frameworks/R.framework/Versions/4.1/Resources/library/flobr/extdata/flobr.pdf: raw [1:133851] 58 0a 00 00 ...
#>  - attr(*, "class")= chr [1:2] "flob" "blob"
flob_name(flob)
#> [1] "flobr"
flob_ext(flob)
#> [1] "pdf"

unflob(flob, tempdir())

all.equal(flob, flob(file.path(tempdir(), "flobr.pdf")), check.attributes = FALSE)
#> [1] TRUE

Installation

To install the latest release from CRAN

install.packages("flobr")

To install the developmental version from GitHub

# install.packages("remotes")
remotes::install_github("poissonconsulting/flobr")

Creditation

The blob package.

The hex was designed by The Forest.

Contribution

Please report any issues.

Pull requests are always welcome.

Code of Conduct

Please note that the flobr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("flobr")

0.2.3 by Joe Thorley, 4 years ago


https://github.com/poissonconsulting/flobr


Report a bug at https://github.com/poissonconsulting/flobr/issues


Browse source code at https://github.com/cran/flobr


Authors: Joe Thorley [aut, cre] , Evan Amies-Galonski [aut] , Poisson Consulting [cph, fnd]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports blob, chk, lifecycle, tools

Suggests covr, spelling, testthat


See at CRAN