Article View: comp.os.msdos.programmer
Article #7732Re: Unerase - how does it wor
From: Paul Rolland
Date: Mon, 25 Jan 1993 08:27
Date: Mon, 25 Jan 1993 08:27
65 lines
3454 bytes
3454 bytes
In article <markus.409.727646157@clement.info.umoncton.ca>, markus@clement.info.umoncton.ca (PAULIN MARC) wrote: > > In article <rol-190193093304@90.222.1.80> rol@grasp1.univ-lyon1.fr (Paul Rolland) writes: > >From: rol@grasp1.univ-lyon1.fr (Paul Rolland) > >Subject: Re: Unerase - how does it wor > >Date: 19 Jan 93 08:31:55 GMT > > >The key, at this point, is to do supposition... Imagine that your disk is > >not fragmented. THen, your file TOTO is stored in contiguous clusters, and > >you have : > >'correct' > >--------- > >FAT: Entry number: Content of this entry > > 3 4 > > 4 5 > > 5 0xfff > > >When it is cleared, you have : > >FAT: Entry number: Content of this entry > > 3 0 > > 4 0 > > 5 0 > >So, if you undelete a file, you check the FAT to see if you have enough > >CONTIGUOUS free clusters starting at the first one allocated to the file, > >and you allocate them to the file you are restoring, rewriting the FAT so > >that it is like the one marked 'correct'. > > > Ok. And what if you have more contiguous space than the actual file > size? UNERASE will bring back a file larger than its original size? If so, > unfragmenting can cause UNERASING problems too. Nice remarks... This tends to prove that you have read my complete post :) No, in fact, you point out something I've completely forgotten (well, it seems that). When you unerase a file, you have the length of the file which is still present in the directory entry. Using this length, you can determine how many clusters are required (just by dividing the length of the file (in byte) by the length of a cluster (in byte too) and then adding 1 *IF* there is a remainder). For example, let's imagin you have a cluster size that is 2048 bytes. If your file is 10000 bytes, you will have 10000/2048=4 and you add 1, so you'll need 5 clusters. If your file is 4096, you'll need 4096/2048 = 2, and you*don't* add 1, so you need 2 free clusters to *try* to undelete ! But you're right, unfragmenting can cause UNERASING problem for these reasons: - First, unfragmenter move clusters, and usually rewrite on the clusters of your lost files, - Second, they sometines clear unused entry in the directories, and an erased files is often considered as unused. Thus, you have no more information on your file, and can't unerase it. Hope that now it is a bit more clear. ***************************************************************************** THIS SHOULD BE PART OF THE FAQ !!!!!!!!!! ***************************************************************************** Paul Rolland A bug can be changed to a feature by documenting it. Developpers know !
Technical Details
Message-ID:
<rol-250193092347@90.222.1.80>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!apple!goofy!NewsWatcher!userReferences:
<703.331.uupcb@filebank.cts.com> <00966C45.D8B54520@Msu.oscs.montana.edu> <rol-190193093304@90.222.1.80> <markus.409.727646157@clement.info.umoncton.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!apple!goofy!NewsWatcher!user From: rol@grasp1.univ-lyon1.fr (Paul Rolland) Newsgroups: comp.os.msdos.programmer Subject: Re: Unerase - how does it wor Message-ID: <rol-250193092347@90.222.1.80> Date: 25 Jan 93 08:27:36 GMT References: <703.331.uupcb@filebank.cts.com> <00966C45.D8B54520@Msu.oscs.montana.edu> <rol-190193093304@90.222.1.80> <markus.409.727646157@clement.info.umoncton.ca> Sender: usenet@goofy.apple.COM Followup-To: comp.os.msdos.programmer Organization: Apple Computer Europe Lines: 65