truncateEndOfFile {collUtils}R Documentation

Truncate n bytes from end of file

Description

Truncate n bytes from end of file

Usage

truncateEndOfFile(filename, len)

Arguments

filename

character. Filename.

len

numeric. Number of bytes to truncate

Author(s)

Kaiyin Zhong

Examples

## Not run: 
fn = tempfile()
f = file(fn, "wb")
writeBin("a", f)
writeBin("b", f)
writeBin("c", f)
close(f)
file.info(fn)$size == 6
truncateEndOfFile(fn, 1)
file.info(fn)$size == 5

## End(Not run)

[Package collUtils version 1.0.5 Index]