mhonarc-dev

RFC: Planned changes to attachment filenaming

2003-09-28 14:47:04

Once the problems with MHonArc CVS tree are fixed, I plan on
committing some changes that affect attachment filenaming.

Currently, attachments are given filenames like:

  doc00000.doc
  jpg00123.jpg

I.e.  Similiar in format as message pages.  However, with planned
support for the new ATTACHMENTDIR resource and to improve performance,
attachment filenames will have more random-type filenames.  For example:

  binFph3Yy9EEe.bin
  jpgA416IQrbTV.jpg
  ps2RUzzPb4Pa.ps

Technical reasons for change:

* The (yet to fully implemented) ATTACHMENTDIR resource would allow
  one to have a single directory to contain all attachments for
  multiple archives.  Therefore, a method must exist for creating
  filenames that avoids race conditions (the current numerical method
  would experience race conditions).

* The random approach avoids the overhead of scanning the directory
  each time to compute the next number.  Although I have not done
  any tests yet, it seems that the scanning method can incur some
  significant overhead of large archives with many files since the
  algorithm is O(n^2).

These changes will probably lead to a different behavior
for filters that support the "subdir" option.  Currently, the
sub-directory is named <msgprefix><msgnum>, but if a shared
attachment directory is used, such naming can cause conflicts.

Therefore, "subdir" should become deprecated, or -- since there
is uses to isolate the attachments of individual messages -- the
subdir filename will have to change, maybe keyed off the message-id.

However, if message-id-based directory names are used, having a shared
attachment directory can still cause a problem when using "subdir"
since you can have a message that is in more than one archive.  If the
message is removed from one archive, deleting the attachment files will
cause the attachments to disappear from the message in other archives.
Possible solutions are to ignore the problem and warn the user about
such usage or develop a reference count system.  I think I will do the
former initially and only do the latter if there is any real incentive.

Objections and/or comments are welcome,

--ewh

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV

<Prev in Thread] Current Thread [Next in Thread>
  • RFC: Planned changes to attachment filenaming, Earl Hood <=