0

file.remove() deletes my files, but they still appear in finder. Am I doing something wrong?

Some test code from this SO question:

file.create(file.path(
  "temp/", 
  paste("test", 1:5, "txt", sep = ".")
))

file.remove(dir(  
  "temp/", 
  pattern = "^test\\.[0-9]\\.txt$", 
  full.names = TRUE
))

After deleting: enter image description here

Confirming deleted: enter image description here

#sessionInfo()
#R version 3.0.2 (2013-09-25)
#Platform: x86_64-apple-darwin10.8.0 (64-bit)
Community
  • 1
  • 1
Eric Green
  • 7,385
  • 11
  • 56
  • 102
  • 2
    sounds more like a "refresh" problem with the Finder. Try this trick: change the display from List to Icons and back again (in the Finder window) and see if the deleted files are still there. – Carl Witthoft Dec 01 '13 at 15:40
  • yeha I am definitely with Carl on that one, in Linux same happens. Refresh the window and the files will be probably gone. – Usobi Dec 01 '13 at 15:46
  • thanks, @Carl. the trick worked. – Eric Green Dec 01 '13 at 16:53

1 Answers1

1

from @Carl Witthoft: Try this trick: change the display from List to Icons and back again (in the Finder window) and see if the deleted files are still there.

Eric Green
  • 7,385
  • 11
  • 56
  • 102