GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Sep-2008, 10:09
Napcrisis Napcrisis is offline
New Member
 
Join Date: Sep 2008
Posts: 8
Napcrisis is an unknown quantity at this point

How to remove a file that prevents recovery in C++


Hi, i have been given an assignment to do as above.. but have completely no idea where to start. Any1 have any idea ? hints or something.. if so please let me know and thank you in advance
Regards
Tom
  #2  
Old 04-Sep-2008, 10:56
ocicat ocicat is offline
Regular Member
 
Join Date: May 2008
Posts: 586
ocicat is a jewel in the roughocicat is a jewel in the rough

Re: How to remove a file that prevents recovery in C++


I can only assume that you are doing this on Windows where file reclamation is the norm anymore.

So, the question may not be whether the file can be reclaimed, but what are the contents of what is reclaimed. My suggestion would be to determine the length of the file, followed by opening it, overwriting its contents with an innocuous pattern, followed by deleting it. There are parts of this solution which may be a bit naive, but it's easy to implement, & it is portable. Depending upon the file's history, blocks of its previous contents may still reside on the drive.

If you want to ensure that the file & all other deleted files are thoroughly deleted, then you will need to research what I/O functions are provided by the operating system, & zero out all unused blocks. Note that this is a more sophisticated approach, but it is operating system specific.
  #3  
Old 05-Sep-2008, 08:59
Napcrisis Napcrisis is offline
New Member
 
Join Date: Sep 2008
Posts: 8
Napcrisis is an unknown quantity at this point

Re: How to remove a file that prevents recovery in C++


Thanks for replying ocicat .. i think thats what i need
For the first solution, i read about it somewhere but not sure if its safe or complete removal.
The second solution, too low level for me lol... im still new to programming so it will be really hard T_T
 
 

Recent GIDBlogNot selected for officer school by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Airport Log program using 3D linked List : problem reading from file batrsau C Programming Language 11 29-Feb-2008 07:44
After execution - Error cannot locate /Skin File? WSCH C++ Forum 1 05-Mar-2005 20:03
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
CD Buring Failed skanth2000 Computer Hardware Forum 1 15-Nov-2003 03:52

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:11.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.