home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / vms / 13757 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  7.7 KB

  1. Xref: sparky comp.os.vms:13757 comp.mail.misc:2686
  2. Newsgroups: comp.os.vms,comp.mail.misc
  3. Path: sparky!uunet!das.wang.com!wang!news
  4. From: jody@lib.haifa.ac.il (Yosef Branse)
  5. Subject: VMS/MAIL - Summary of Replies to DELETE/ALL Query (13-Aug)
  6. Organization: Haifa University Library
  7. Date: Tue, 18 Aug 1992 12:57:28 GMT
  8. Message-ID: <1992Aug18.145728.1@lib.haifa.ac.il>
  9. Sender: news@wang.com
  10. Lines: 136
  11.  
  12. I would like to thank everyone who responded to my recent query as to why 
  13. the DELETE/ALL command in VMS MAIL also does away with the folder from which
  14. the items are deleted. The replies were prompt, cordial and 
  15. informative. For the benefit of others, I append a summary of what
  16. I learned about the nature of the phenomenon and possible solutions. 
  17. There is some repetition here, but I included a number of replies so as to 
  18. incorporate information that appears in one post but not others.
  19.  
  20. First, two corrections to my original message:
  21.  
  22. - the same thing would happen if I deleted the items in the folder one by
  23.   one; DELETE/ALL just makes it happen faster
  24.  
  25. - I described the loss of the folder as "like chucking out your filing cabinet
  26. every time you throw out some old letters!"
  27.  
  28. "No, deleting MAIL.MAI would be like chucking your filing cabinet. Deleting
  29. an empty folder is like pulling a manila file folder out of the cabinet
  30. and tossing it in the trash can. What you are suggesting is like pulling
  31. a manila file folder out of the cabinet, removing the papers inside it,
  32. and throwing them in the trash, and then putting the empty manila folder
  33. back into the drawer." (Bob Marshall)
  34.  
  35. I. Why does the problem occur?
  36.  
  37. "To understand this you have to understand how MAIL stores messages.
  38. The core is the indexed sequential file MAIL.MAI. This file has records
  39. for each message and each record has two keys. The primary key is based
  40. on the timestamp of when the message was received. The second, alternate
  41. key is the name of the folder in which the message has been filed. This
  42. alternate key is the only place where VMS keeps track of which folders
  43. exist so a folder cannot exist without a message in it. This has the
  44. benefit of simplicity as the file only contains one type of record. It
  45. is also why messages in a folder are always sorted by date. When MAIL
  46. reads the file by the alternate key it gets the records in primary key
  47. order." (Bruce Hudson)
  48.  
  49. "I think most of the behavior you're seeing is due to the structure of the
  50. VMSMAIL datafile you have in your directory. Folders are merely a construct of
  51. the file structure in that they are RMS secondary keys into this ISAM file. 
  52. When you re-file stuff in another folder, MAIL takes all records in the file
  53. with that secondary key and changes the key to a new folder name.  So, when you
  54. delete all memos in a specific folder, you're really deleting all records which
  55. contain this secondary key.  With no records present, the folder no longer
  56. exists." (Michael Vilain)
  57.  
  58. "In the current VMSmail implementation, a folder name has no separate
  59. existance outside of just being a particular value of a key field in one
  60. or more VMSmail records.  Doing a directory of a particular folder is done
  61. by just looking up all the records with a that value in the folder name
  62. field (in the order of the other key, the record creation date/time).
  63. Deleting all the messages in a folder is done by deleting all the records
  64. in the mail file with some particular value in the folder name field (and
  65. the associated message files).  So there is no way to get the behavior you
  66. want without re-designing the mail file format, something that's not likely
  67. to happen soon if at all" (James Harvey)
  68.  
  69. "In order to understand this phenomenon, you have to know a little bit about
  70. how mail messages are stored in the MAIL.MAI file: The header of each message
  71. (From, To, Subject, date/time, some flags and other information) occupies a
  72. single record in the MAIL.MAI file.  The mail file is an indexed file (i.e.
  73. each record has one or more "keys" on which retrieval may be based).  This is
  74. done to avoid sequential searches on certain operations (such as those based on
  75. date/time of receipt -- or on folder name).  One of the key fields is the
  76. "folder name".  It is simply a 39-character part of each mail message header
  77. record.  There's no special data structure that represents a folder -- if the
  78. "folder name" field of any record in the mail file contains a particular
  79. string, then that folder exists (and any record containing that string in its
  80. "folder name" field belongs to that folder.  Thus, if you delete all records
  81. containing a particular name in the "folder name" field (e.g. by a DELETE/ALL
  82. or MOVE/ALL), then there are no more records containing that folder name -- and
  83. the folder ceases to exist." (John Osudar)
  84.  
  85. "There's no such thing as an empty folder in VMSmail.  The folder
  86. name is used as the secondary index into MAIL.MAI; once all the keys for
  87. a specific folder are gone, so is all record of that folder.  Deleting
  88. items individually would produce the same results as delete/all, as would
  89. using move instead of delete.  The only exception is the wastebasket
  90. folder; its name--if different from the default--is explicitly recorded
  91. in the user's mail profile and it is recreated as necessary without any
  92. confirmation prompt." (Pat Rankin)
  93.  
  94. "MAIL rebuilds the folder structure (on DIR/FOLDER) by scanning all messages
  95. noting the folders in use." (Steve Hirby)
  96.  
  97. "This technique turns out to be really convenient for operations like FILE,
  98. MOVE (both within the same mail file), and also DELETE (i.e. "file in waste-
  99. basket"), since all of these involve no actual movement of the record, but
  100. simply an update of the "folder name" field.  The behavior you see is one
  101. of the side effects.
  102. It is true that DEC could have invented a unique record type that would
  103. serve as a "folder header", so that even if you delete all the messages in
  104. a folder, one record would remain with that folder name.  They chose not to
  105. do so, probably to avoid the added complication of requiring commands like
  106. CREATE/FOLDER, DELETE/FOLDER, etc." (John Osudar)
  107.  
  108.  
  109. II. What can one do about it?
  110.  
  111. "Now that the DELETE command accepts message numbers and ranges as a
  112. parameter, you could just "DELETE 2-" and always leave a message in the
  113. folder." (Bruce Hudson)
  114.  
  115. "You might try using MOVE/NOCONFIRM or FILE/NOCONFIRM when you're
  116. reorganizing your messages." (Pat Rankin)
  117.  
  118. I have switched to using FILE/NOCONFIRM, with a keypad key redefined for that,
  119. and it is a good solution. I really don't care that the folders are recreated
  120. anew occasionally, and this command does it transparently - I don't have to 
  121. respond to the "Do you want to create..." prompt. I still get a message that
  122. the folder has been created.
  123.  
  124. III. Acknowledgements:
  125.  
  126. Bruce Hudson <hudson@ug.cs.dal.ca>
  127. pack@acd.ucar.edu (Daniel Packman)
  128. Michael Vilain <vilain@apple.com>
  129. James Harvey <HARVEY@INDYVAX.IUPUI.EDU>
  130. Carl J Lydick <carl@SOL1.GPS.CALTECH.EDU>
  131. rankin@EQL.CALTECH.EDU (Pat Rankin)
  132. Jerry Leichter <leichter@lrw.com>
  133. "Steve H. - 6553" <HIRBYS@LAWRENCE.EDU>
  134. OSUDAR@cmt.anl.gov (John Osudar {708 252-7505})
  135. GAVRON@ALPHA.SUNQUEST.COM (Ehud Gavron 602-570-2000 x. 2546)
  136. j_manning@csc32.enet.dec.com (John Manning)
  137. marshall@force.ssd.lmsc.lockheed.com (Bob Marshall)
  138. kej@unix.brighton.ac.uk (-* Terminal Rat *-)
  139. -- 
  140. ****************************************************************************
  141. * Yosef (Jody) Branse             University of Haifa Library              *
  142. *                                 Mt. Carmel, Haifa 31905, Israel          *
  143. *                                 Tel.: 972 4-240288                       *
  144. *                                 FAX:  972 4-257753                       *
  145. * Israeli U. DECNET: HAIFAL::JODY                                          *
  146. * Internet/ILAN:     JODY@LIB.HAIFA.AC.IL                                  *
  147. ****************************************************************************
  148.