Bug in R 3.6.1: When file.copy deletes your file !
A <- 10
save(A, file="A.Rdata")
file.symlink(from="A.Rdata", to="B.Rdata")
rm(A)
load(file="B.Rdata")
print(A)
system("ls -l")
file.copy(from="A.Rdata", to="B.Rdata", overwrite = TRUE)
# A.Rdata becomes empty: 0B
system("ls -l")
# In terminal
marcgirondot$ ls
A.Rdata
marcgirondot$ ln -s A.Rdata B.Rdata
marcgirondot$ ls -l
-rw-r--r-- 1 marcgirondot staff 70 13 sep 11:38 A.Rdata
lrwxr-xr-x 1 marcgirondot staff 7 13 sep 11:38 B.Rdata -> A.Rdata
marcgirondot$ cp A.Rdata B.Rdata
cp: B.Rdata and A.Rdata are identical (not copied).
save(A, file="A.Rdata")
file.symlink(from="A.Rdata", to="B.Rdata")
rm(A)
load(file="B.Rdata")
print(A)
system("ls -l")
file.copy(from="A.Rdata", to="B.Rdata", overwrite = TRUE)
# A.Rdata becomes empty: 0B
system("ls -l")
# In terminal
marcgirondot$ ls
A.Rdata
marcgirondot$ ln -s A.Rdata B.Rdata
marcgirondot$ ls -l
-rw-r--r-- 1 marcgirondot staff 70 13 sep 11:38 A.Rdata
lrwxr-xr-x 1 marcgirondot staff 7 13 sep 11:38 B.Rdata -> A.Rdata
marcgirondot$ cp A.Rdata B.Rdata
cp: B.Rdata and A.Rdata are identical (not copied).
Commentaires
Enregistrer un commentaire