6

freaddata.table包中使用过,当我尝试修改或删除文件(只需用记事本打开)时,窗口会说:

在此处输入图像描述

如何解锁此绑定?

编辑:

在 R 中尝试给出相同的结果

cat(file="C:/Users/MCarrie/Desktop/test/test2.txt")
Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Users/MCarrie/Desktop/test/test2.txt': Permission denied

信息:

> sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.8.8

loaded via a namespace (and not attached):
[1] tools_3.0.1

> showConnections(all=T)
  description class      mode text   isopen   can read can write
0 "stdin"     "terminal" "r"  "text" "opened" "yes"    "no"     
1 "stdout"    "terminal" "w"  "text" "opened" "no"     "yes"    
2 "stderr"    "terminal" "w"  "text" "opened" "no"     "yes"  

正在读取的文件:(故意缺少报价)

"AA",3,4,5,"w"
"ss,2,3,4,"s"
"ww",2,3,3,"s"
4

1 回答 1

5

请使用 data.table v1.8.11 重试。data.table 主页上有一个适用于 Windows 的新 .zip 。

来自新闻

如果 fread 返回数据错误(例如特定行上的不平衡引号),它现在首先关闭文件,而不是保持打开锁,这是 Windows 唯一的问题。感谢 nigmastar 的报告和 Carl Witthoft 的提示。添加了测试。

于 2013-09-03T17:42:06.473 回答