1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/blob.R
\name{hashfile}
\alias{hashfile}
\title{Determine the sha from a blob in a file}
\usage{
hashfile(path = NULL)
}
\arguments{
\item{path}{The path vector with files to hash.}
}
\value{
A vector with the sha for each file in path.
}
\description{
The blob is not written to the object database.
}
\examples{
\dontrun{
## 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"))
}
}
|