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

  1. Path: sparky!uunet!gatech!usenet.ins.cwru.edu!agate!spool.mu.edu!olivea!charnel!sifon!clouso.crim.ca!hobbit.ireq.hydro.qc.ca!beaurega
  2. From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Unerase - how does it wor
  5. Message-ID: <C1Brn7.650@ireq.hydro.qc.ca>
  6. Date: 23 Jan 93 20:59:30 GMT
  7. References: <703.331.uupcb@filebank.cts.com> <C111JG.H5q@ireq.hydro.qc.ca> <markus.403.727387680@clement.info.umoncton.ca>
  8. Sender: news@ireq.hydro.qc.ca (Netnews Admin)
  9. Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada
  10. Lines: 62
  11.  
  12. In article <markus.403.727387680@clement.info.umoncton.ca> markus@clement.info.umoncton.ca (PAULIN MARC) writes:
  13. >In article <C111JG.H5q@ireq.hydro.qc.ca> beaurega@ireq.hydro.qc.ca (Denis Beauregard) writes:
  14. >>Now, about the poster question.  How does UNERASE to retrieve the chain?
  15. >>It guesses.  A sequential written file (i.e. after saving a text file)
  16. >>will use the sequential available clusters and the "erased" file entry
  17. >>still contains the 1st FAT entry position.  Thus, the 1st guest is
  18. >>that 1st FAT and the next available clusters.  Is the file is less than
  19. >>one cluster size (i.e. with older DOS versions and larger disks, 
  20. >>a cluster was likely 8k, with
  21. >>last DOS or smaller disks, it is more likely 2k), so if the file is small
  22. >>enough (and the UNERASE program knows the size of a cluster) and the cluster
  23. >>is available, then the UNERASE program will say that this file can be unerased.
  24. >>But if the file is larger, then the probability it can be unerased is smaller.
  25. >>To add to confusion, some disk utility will preserve the chains after
  26. >>erasing a file, so the files can be unerased with less guess.  Also, there is
  27. >>probably some method (which I just don't know) to find the chain in DOS
  28. >>memory, but this is a guess.
  29. >
  30. >
  31. >    Es-tu sur?  It guesses?  You mean it guesses the file position on 
  32. >the disk?  I doubt it.  What if the file is fragmented?  That's not 
  33.  
  34. Most data is written in the next sequentially available cluster.
  35. In other words, if I read a large file into memory, modify it and save
  36. it to disk, the clusters DOS will use will be each consecutive available
  37. cluster.  Fragmentation will occur later, after you erased files using
  38. the intermediate clusters.
  39.  
  40. >sequential.  When the file is erased, the pointers in the FAT that points to 
  41. >the clusters are not erased.  Only the first character of the filename is.  
  42.  
  43. Yes, they are.  See the FAT format.  A FAT entry indicates either a
  44. free cluster, the next cluster for the same file or the last cluster in
  45. a file.  Nothing to link a free cluster.  Actually, the DOS does this:
  46. in the directory entry, erase the name by overwritting the 1st character;
  47. in the FAT table, replace all cluster links entries by free cluster entries.
  48. From the directory erase operation, the 1st cluster position is known,
  49. but from the FAT operation, the other clusters are unknown.  The guess
  50. is on the other clusters.
  51.  
  52. >When you use UNERASE or UNDELETE, it checks the directory structure for 
  53. >filenames with the first character deleted, then checks the FAT if all the 
  54. >pointers are there and intact, then asks you for the character.  Don't 
  55.  
  56. It can't.  Only the first cluster is known.  The chain is missing.
  57.  
  58. >forget that the filename found in the directory contains the address of the 
  59. >first pointer in the FAT.  So it's not a sequential search.  Imagine for a 
  60. >500Meg HD, it would take dozens of minutes to sequentially scan all 
  61. >available clusters.
  62.  
  63. So, try this test.  Write many small files.  Delete some of them so as
  64. to create a random pattern.  Re-boot (if you don't, DOS will continue
  65. to write at the next cluster available following the last write).
  66. Write a large file.  Delete the many small files and the large file.
  67. Try to unerase the large file and give me some news...
  68.  
  69. -- 
  70.   \_\    Denis Beauregard  *  internet:beaurega@ireq.hydro.qc.ca
  71.  /   \   Ge'ne'alogiste des familles : Beauregard/Jarret/Jarest/Vincent
  72. J   __>  Un Que'bec renouvele' dans une Ame'rique renove'e
  73. \_.-===  Ope'rateur de "Racines du Que'bec" (514) 922-9636 BBS/Genealogie
  74.