Limit of file size for truncate in R

可紊 提交于 2019-12-10 15:57:03

问题


From ?truncate:

truncate truncates a file opened for writing at its current position. It works only for file 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?


回答1:


  1. According to the source, a missing 64-bit version of the underlying ftruncate system call. It seems that this issue can/will be resolved when the MinGW used to build R is updated.
  2. No.
  3. No.
  4. The Win32 API is called SetEndOfFile, and a GitHub search for CRAN packages found eight hits. Good luck :-)


来源:https://stackoverflow.com/questions/32721789/limit-of-file-size-for-truncate-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!