From ?truncate
:
truncate
truncates a file opened for writing at its current position. It works only forfile
connections, and is not implemented on all platforms: on others (including Windows) it will not work for large (> 2Gb) files.
What is the cause of the 2Gb limit on Windows? Does it matter if it's 64bit Windows, or the file system is NTFS? Does the version of Windows matter (XP, 7, 8, 10)?
Is there a built-in R function or a function in some R package that achieves the same effect on Windows as truncate
on Unix-like systems?