From bee3701e60fa887767fd165c9623fd854660253b Mon Sep 17 00:00:00 2001 From: Sebastian Gibb Date: Wed, 12 Feb 2020 11:17:35 +0100 Subject: [PATCH] fix: change open mode to allow file manipulation with an offset --- R/OnDiskVector-class.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/OnDiskVector-class.R b/R/OnDiskVector-class.R index 1864d4d..d766d0e 100644 --- a/R/OnDiskVector-class.R +++ b/R/OnDiskVector-class.R @@ -122,7 +122,7 @@ setReplaceMethod(f="[", if (length(value) != x@n) { stop("Length of 'value' doesn't match length of 'x'.") } - f <- file(x@path, "wb") + f <- file(x@path, "r+b") on.exit(close(f)) if (x@offset)