How do I delete a file permanently (make it unrecovereable) ? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How do I delete a file permanently (make it unrecovereable) ?

analyseranalyser Posts: 1Member
How do I delete a file for good in DOS (so that data recovery tools couldn't recover it) ? I need a source code example, if you can give it to me).
Trillions of thanks ;)

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : How do I delete a file for good in DOS (so that data recovery tools couldn't recover it) ? I need a source code example, if you can give it to me).
    : Trillions of thanks ;)
    :
    [blue]I do not have much time to write code right now, but here is an idea:

    1. Open a target file for READ/WRITE access
    2. Get its size into some variable - say 'fSizeBytes'
    3. Write into the file 'fSizeBytes' times random byte value
    effectively erasing all data.
    4. Close file
    5. Delete file

    The file is possible to recover, but no valuable bytes will be present in there...[/blue]
  • ASHLEY4ASHLEY4 Posts: 254Member
    : : How do I delete a file for good in DOS (so that data recovery tools couldn't recover it) ? I need a source code example, if you can give it to me).
    : : Trillions of thanks ;)
    : :
    : [blue]I do not have much time to write code right now, but here is an idea:
    :
    : 1. Open a target file for READ/WRITE access
    : 2. Get its size into some variable - say 'fSizeBytes'
    : 3. Write into the file 'fSizeBytes' times random byte value
    : effectively erasing all data.
    : 4. Close file
    : 5. Delete file
    :
    : The file is possible to recover, but no valuable bytes will be present in there...[/blue]
    :

    As far as i know ,if it was a text file say and you opened it and deleted the contents and filled it with rubish (any old textand maded shore it was bigger.)and pressed save,
    The origernel file is over ritten ??????????.
    Is this true?
    \|///
    (@@)
    ASHLEY4.


  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : : : How do I delete a file for good in DOS (so that data recovery tools couldn't recover it) ? I need a source code example, if you can give it to me).
    : : : Trillions of thanks ;)
    : : :
    : : [blue]I do not have much time to write code right now, but here is an idea:
    : :
    : : 1. Open a target file for READ/WRITE access
    : : 2. Get its size into some variable - say 'fSizeBytes'
    : : 3. Write into the file 'fSizeBytes' times random byte value
    : : effectively erasing all data.
    : : 4. Close file
    : : 5. Delete file
    : :
    : : The file is possible to recover, but no valuable bytes will be present in there...[/blue]
    : :
    :
    : As far as i know ,if it was a text file say and you opened it and deleted the contents and filled it with rubish (any old textand maded shore it was bigger.)and pressed save,
    : The origernel file is over ritten ??????????.
    : Is this true?
    : \|///
    : (@@)
    : ASHLEY4.
    :
    :
    :
    [blue]That depends on a program that you use to save this file. Some programs just to be safe will first create a fresh file, so the old file will remain untouched and then only after saving will rename fresh file and remove the old one. In that case - the old text will be left intact and is possible to recover with some DOS file doctor.[/blue]
  • ASHLEY4ASHLEY4 Posts: 254Member
    : : : : How do I delete a file for good in DOS (so that data recovery tools couldn't recover it) ? I need a source code example, if you can give it to me).
    : : : : Trillions of thanks ;)
    : : : :
    : : : [blue]I do not have much time to write code right now, but here is an idea:
    : : :
    : : : 1. Open a target file for READ/WRITE access
    : : : 2. Get its size into some variable - say 'fSizeBytes'
    : : : 3. Write into the file 'fSizeBytes' times random byte value
    : : : effectively erasing all data.
    : : : 4. Close file
    : : : 5. Delete file
    : : :
    : : : The file is possible to recover, but no valuable bytes will be present in there...[/blue]
    : : :
    : :
    : : As far as i know ,if it was a text file say and you opened it and deleted the contents and filled it with rubish (any old textand maded shore it was bigger.)and pressed save,
    : : The origernel file is over ritten ??????????.
    : : Is this true?
    : : \|///
    : : (@@)
    : : ASHLEY4.
    : :
    : :
    : :
    : [blue]That depends on a program that you use to save this file. Some programs just to be safe will first create a fresh file, so the old file will remain untouched and then only after saving will rename fresh file and remove the old one. In that case - the old text will be left intact and is possible to recover with some DOS file doctor.[/blue]
    :

    Thanks AsmGuru62.
    ASHLEY4.



  • wstillwellwstillwell Posts: 20Member
    : : : : : How do I delete a file for good in DOS (so that data recovery tools couldn't recover it) ? I need a source code example, if you can give it to me).
    : : : : : Trillions of thanks ;)
    : : : : :

    Try This - It's "IBM C4/2 approved :

    Using a sector editor, locate the address of the file, it's BOF and EOF, then perform a low-level 7x cluster purge within the address range(s) where the file previously existed. Then leave the address range the BOF/EOF empty, filled w 0's, 1', or garbage. It'll be gone regardless...

    -b stillwell
    -ibm tjwrc
Sign In or Register to comment.