list.files returns unwanted files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

list.files returns unwanted files

Lipatz Jean-Luc
Hi all,

I have found a strange behaviour with 'list.files' (it can easily be bypassed with the 'pattern' argument but doesn't seem to me very constistent to the 'files.all' one):
The problem is that Windows files begining with a tilde are returned by list.files, even if they are hidden.

I reproduced the behaviour, opening an existing document 'Test.doc' with Microsoft Word. The result is then:
> list.files("D:/h2izgk/Essais")
 [1] "~$Test.doc" "Test.doc"

Under the Windows explorer, the first file appears only if the hidden files are made visible, and the actual name that is displayed is ".~lock.Test.doc#" (another strange thing)
Such files seem to be temporary ones and are not specific to MS Word and it appears that some of them survive to the closing of their application.

Thanks

> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252    LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252

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

other attached packages:
[1] inline_0.3.14     MASS_7.3-47       iplots_1.1-7      rJava_0.9-8       sourcetools_0.1.6

loaded via a namespace (and not attached):
[1] tools_3.3.3 png_0.1-7


        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Loading...