我使用
data.table
包中的fread
函数。当我尝试修改或删除文件(只需用记事本打开)时,Windows会提示:
如何解除此绑定?
编辑:
在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"
data.table::fread
在读取完成后会执行close
吗? - Carl Witthoft