home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.11 / text0089.txt < prev    next >
Encoding:
Internet Message Format  |  1987-07-18  |  1.8 KB

  1. From: mmengel@cuuxb.uucp (Marc W. Mengel)
  2.  
  3. In article <8440@ut-sally.UUCP>;
  4. >I noted Marc Mengel's suggestion that tar write out the contents of a file
  5. >when the last link to a file is encountered, rather than the first.  This
  6. >would be nice, but I don't see how it could be done in a way that is
  7. >backward compatible with the current tar format.  
  8.  
  9.  
  10. Maybe I was too brief in my attempt at describing it... What you do
  11. is make two recursive descents of the directory tree.  
  12.  
  13. In the first recursive descent, you generate a table that looks like
  14.  
  15.     file id #    last place seen in recursive descent
  16.     123        foo/bar/baz
  17.     333        foo/baz/bleem
  18. ...
  19.  
  20. Each time you encounter a file in the recursive descent you either add it
  21. to the list, if its file id # isn't there, or replace its pathname in 
  22. the second half of the table.
  23.  
  24. In the second recursive descent, you look up each file you see in the table,
  25. (by file id #) and if its path-from-the-table matches the current path,
  26. you write out the file on the archive, otherwise you mark the current 
  27. path as a link to path-from-the-table in the archive.
  28.  
  29. Since our two recursive descents of the file tree should be identical, we
  30. should always have only the last reference to a given file with data, and
  31. all earlier references to that file listed as links to the one later on
  32. the archive.
  33.  
  34. (Of course we only need to put files in the table that have multiple
  35. links...)
  36.  
  37. So I am asking that a notation be put in the tar archive format for a
  38. link to another file in the archive, along with the requirement that 
  39. link-to-file-"foo" nodes in the archive must always precede file-"foo"
  40. nodes.
  41.  
  42.  
  43. [ If you want to make a proposal to the P1003.1 Working Group,
  44. you need to supply actual wording for the standard.  -mod ]
  45.  
  46. -- 
  47.  Marc Mengel
  48.  attmail!mmengel
  49.     or
  50.  ...!{moss|lll-crg|mtune|ihnp4}!cuuxb!mmmengel
  51.  
  52.  
  53. Volume-Number: Volume 11, Number 90
  54.  
  55.