home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / apple2 / 26102 < prev    next >
Encoding:
Text File  |  1992-12-29  |  3.1 KB  |  65 lines

  1. Newsgroups: comp.sys.apple2
  2. Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!alberta!cpsc.ucalgary.ca!debug!griffin!dockery
  3. From: dockery@griffin.cuc.ab.ca (Sean Dockery)
  4. Subject: Re: ProDOS files vs. disk
  5. Message-ID: <BzzMHH.2AB@griffin.cuc.ab.ca>
  6. Organization: Synchrotron Software Group, Calgary, Alberta
  7. References: <9212280139.AA10293@apple.com>
  8. Date: Mon, 28 Dec 1992 21:03:16 GMT
  9. Lines: 54
  10.  
  11. In article <9212280139.AA10293@apple.com> ST2975@SIUCVMB.SIU.EDU writes:
  12. >I seemed to have noticed that files on my disks aren't exactly
  13. >contiguous.  There seem to be 512 byte 'holes' on the disk that
  14. >separate different files' data.  Is this an optimization of
  15. >ProDOS?  Can I write a disk utility that can move the files'
  16. >data closer together and change the directory structure to reflect
  17. >the change using read_block/write_block and read/write?
  18. >I'm using ProDOS v1.9 currently.  Am I imagining things as usual?
  19. >
  20. >Andy Werner
  21. >st2975@siucvmb.siu.edu
  22.  
  23. Andy, you are not imagining things at all.  ProDOS uses this block
  24. method of storage because it allows more files on a disk than would be
  25. possible for sequential storage.
  26.  
  27. Example:  If you have many small files on a disk which were written to
  28. sequentially, deleting some of them randomly would free up sections of
  29. the disk which do not fall into a consecutive pattern.  Although the
  30. total number of blocks free on the disk may be enough of a volume to
  31. contain a file currently in memory, requiring that the file be written
  32. sequentially might mean that it would not be possible to save it.
  33.  
  34. ProDOS has overcome this problem by allowing different blocks to be
  35. linked via a pointer in the original directory entry for that file.
  36. Depending on the file type, the pointer may point directly to the data
  37. block of the file (as the case with a seedling file,) a block of
  38. pointers which point to the data blocks of the file (as the case with
  39. a sapling file,) or a block of handles which point to a block of
  40. pointers which point to data blocks of the file (as the case with a
  41. tree file.)  There is also another file type (extended files) which
  42. is available under GS/OS only (not ProDOS 8) which contain two logical
  43. data segments (resource and data forks.)
  44.  
  45. The version of the ProDOS doesn't matter.  It has been done this way
  46. since the original version -- otherwise, ProDOS would not be backward
  47. compatible because the structure on the disk would not be the same.
  48.  
  49. As for a utility to remedy you problem, you want a program called a
  50. defragmenter.  I'm sure that Glen Bredon has written something for
  51. smaller disks in his ProSel 8 package as someone suggested (what kind
  52. of utility hasn't he written!)
  53.  
  54. If you want to know more about the actual management of ProDOS and
  55. GS/OS disk storage devices, I would recommend _Exploring Apple GS/OS
  56. and ProDOS 8_ by Gary B. Little (Addison-Wesley Publishing Company --
  57. copyright (c) 1988.)
  58.  
  59. sean
  60. -- 
  61. # internet: dockery@griffin.cuc.ab.ca   | "alone.  death can't hold a candle
  62. #      -or- dockery@pro-calgary.cts.com |  to it, and hell is a poor synonym"
  63. # pro-line: dockery@pro-calgary         |                       -stephen king
  64. #     uucp: crash!pro-calgary!dockery   | disclaimer: i am unemployed
  65.