hashfile: Determine the sha from a blob in a file

View source: R/blob.R

hashfileR Documentation

Determine the sha from a blob in a file

Description

The blob is not written to the object database.

Usage

hashfile(path = NULL)

Arguments

path

The path vector with files to hash.

Value

A vector with the sha for each file in path.

Examples

## Not run: 
## Create a file. NOTE: The line endings from writeLines gives
## LF (line feed) on Unix/Linux and CRLF (carriage return, line feed)
## on Windows. The example use writeChar to have more control.
path <- tempfile()
f <- file(path, "wb")
writeChar("Hello, world!\n", f, eos = NULL)
close(f)

## Generate hash
hashfile(path)
identical(hashfile(path), hash("Hello, world!\n"))

## End(Not run)

git2r documentation built on Nov. 26, 2023, 5:06 p.m.

Related to hashfile in git2r...