home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / msdos / programm / 12424 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  3.3 KB

  1. Path: sparky!uunet!olivea!apple!goofy!NewsWatcher!user
  2. From: rol@grasp1.univ-lyon1.fr (Paul Rolland)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Unerase - how does it wor
  5. Message-ID: <rol-250193092347@90.222.1.80>
  6. Date: 25 Jan 93 08:27:36 GMT
  7. 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>
  8. Sender: usenet@goofy.apple.COM
  9. Followup-To: comp.os.msdos.programmer
  10. Organization: Apple Computer Europe
  11. Lines: 65
  12.  
  13. In article <markus.409.727646157@clement.info.umoncton.ca>,
  14. markus@clement.info.umoncton.ca (PAULIN MARC) wrote:
  15. > In article <rol-190193093304@90.222.1.80> rol@grasp1.univ-lyon1.fr (Paul Rolland) writes:
  16. > >From: rol@grasp1.univ-lyon1.fr (Paul Rolland)
  17. > >Subject: Re: Unerase - how does it wor
  18. > >Date: 19 Jan 93 08:31:55 GMT
  19. > >The key, at this point, is to do supposition... Imagine that your disk is
  20. > >not fragmented. THen, your file TOTO is stored in contiguous clusters, and
  21. > >you have :
  22. > >'correct'
  23. > >---------
  24. > >FAT:   Entry number:     Content of this entry
  25. > >             3                      4
  26. > >             4                      5
  27. > >             5                    0xfff
  28. > >When it is cleared, you have :
  29. > >FAT:   Entry number:     Content of this entry
  30. > >             3                      0
  31. > >             4                      0
  32. > >             5                      0
  33. > >So, if you undelete a file, you check the FAT to see if you have enough
  34. > >CONTIGUOUS free clusters starting at the first one allocated to the file,
  35. > >and you allocate them to the file you are restoring, rewriting the FAT so
  36. > >that it is like the one marked 'correct'.
  37. >     Ok.  And what if you have more contiguous space than the actual file 
  38. > size?  UNERASE will bring back a file larger than its original size?  If so, 
  39. > unfragmenting can cause UNERASING problems too.
  40.  
  41. Nice remarks... This tends to prove that you have read my complete post :)
  42. No, in fact, you point out something I've completely forgotten (well, it
  43. seems that). When you unerase a file, you have the length of the file which
  44. is still present in the directory entry. Using this length, you can
  45. determine how many clusters are required (just by dividing the length of
  46. the
  47. file (in byte) by the length of a cluster (in byte too) and then adding 1
  48. *IF* there is a remainder). For example, let's imagin you have a cluster
  49. size
  50. that is 2048 bytes. If your file is 10000 bytes, you will have 10000/2048=4
  51. and you add 1, so you'll need 5 clusters. If your file is 4096, you'll
  52. need 4096/2048 = 2, and you*don't* add 1, so you need 2 free clusters to
  53. *try* to undelete !
  54. But you're right, unfragmenting can cause UNERASING problem for these
  55. reasons:
  56.   - First, unfragmenter move clusters, and usually rewrite on the clusters
  57. of
  58. your lost files, 
  59.   - Second, they sometines clear unused entry in the directories, and an
  60. erased files is often considered as unused. Thus, you have no more
  61. information
  62. on your file, and can't unerase it.
  63.  
  64. Hope that now it is a bit more clear.
  65.  
  66. *****************************************************************************
  67. THIS SHOULD BE PART OF THE FAQ !!!!!!!!!!
  68. *****************************************************************************
  69.  
  70. Paul Rolland
  71.  
  72. A bug can be changed to a feature by documenting it. Developpers know !
  73.