truncateEndOfFile: Truncate n bytes from end of file

Description Usage Arguments Author(s) Examples

View source: R/readbed.R

Description

Truncate n bytes from end of file

Usage

1
truncateEndOfFile(filename, len)

Arguments

filename

character. Filename.

len

numeric. Number of bytes to truncate

Author(s)

Kaiyin Zhong

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

collUtils documentation built on May 2, 2019, 8:23 a.m.