File deletion

This is a discussion on File deletion within the Tech Board forums, part of the Community Boards category; I was just watching an uninstaller run today (uninstalling WindowBlinds, trial period was over and I didn't think much of ...

  1. #1
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709

    File deletion

    I was just watching an uninstaller run today (uninstalling WindowBlinds, trial period was over and I didn't think much of it anyway) and got to thinking, how are files actually physically erased from disk?

    I'm not talking about any particular OS here.

    So would I be right in thinking the file is overwritten with 0's? Or is the process dependant on the file system being used? Or the OS?

    Just curious.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    Nah, mostly it's just by removing the directory entry from the file system.
    Actually, it's more like just set a specific bit in the directory entry which means 'deleted'.

    File recovery firms make use of this to recover the contents of files you've deleted by mistake.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255
    The file system is just another database, and like other databases, when you "delete" something, all you're doing is detaching it from a data structure. It's still physically there until something writes over it (now that it's a "free" block).

    P.S. Wouldn't it be cool to be able to run SQL queries on a file system?

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Secure deletion programs overwrite the file with garbage before deleting it so data recovery programs can't recover the file.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    ---
    Join Date
    May 2004
    Posts
    1,379
    So what is the difference between a quick format and a regular (slow) format? I would guess that a slow format would "zero" out the file system.

  6. #6
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255
    Yes, although a slow format is more about verifying sectors. Touch every part of the volume to be erased and if the hardware comes back with an error at any point you've saved some heartache.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  4. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21