get_dos: Get file hash of dos line-ending version of file

Description Usage Arguments Value

Description

Returns the hash of the file with line endings converted to dos format. This is done by creating a temporary file with the alternate endings, hashing and cleaning up the file. The purpose is to allow for comparison of dupes where line endings have been changed between dos and unix formats, making the files have different hashes. Different hashing algoritms can be used, with the default being md5sum. Underlying work is performed by the digest package. The file line ending conversion is performed by unix2dos and requires that this program is installed. Note that unix2dos identifies binary files and forgoes the line ending conversion. In this case, a default is used for the get_dos function.

Usage

1
get_dos(path, algo = "md5", default = get_hash(path))

Arguments

path

The path to a file

algo

The hashing algorithm as a string. Default is "md5". See the digest package for allowable values.

default

The value to use for binary files. By default, the file hash without modification is used. Alternatively, use default=NA to skip hash generation for binary files.

Value

The file hash as a string, or default


gmyrland/fduper documentation built on May 28, 2019, 8:53 p.m.