• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Does Apache Common Io File utils empty the file before deleting the files

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need to know whether FileUtils of apache empty the file before deleteing it , does that file contect still be in memory.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at its source code.
The answer is that no it doesn't modify or delete a file's contents.
It just tries to delete the file by asking the OS to do so.
No different from a person deleting a file in a file manager application.

Can its contents be in memory? Yes, if you read the contents into a buffer but that buffer has not yet been garbage collected by JVM, it can be in JVM's memory.
Even when it's garbage collected, it's possible its contents are still in RAM or swap file. Any program that scans memory or swap file - looking for things like english words or sequence of ASCII characters, for example - can find them.

If you meant can deleted file's contents be recovered from disk, yes that too is possible. None of the popular filesystems - ext4/FAT/NTFS - scrub the space after a file is deleted.

What exactly is your requirement?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic