On Wed, 17 Feb 1999, Brian Reichert wrote:

> On Wed, Feb 17, 1999 at 01:18:33PM +1100, Mark Delany wrote:
> > >Is the inode just a handy unique number?  Or are there file access
> > >speed tricks, e.g. opening files directly using inode.
> > 
> > Handy unique filename. Vastly superior to tmpnam() and all the lame 
> > variants that go with it.

I often wondered why Dan chose to do queue filenames by inode, but use
timestamp-pid-host for creating unique filenames within a maildir.  Then I
remembered that qmail-queue is a long-running daemon and so will have the
same pid for long periods of time.  It seems that there ought to be
another piece of information that could be used to make a similar filename
unique, without going through tmpnam.  I suppose you could even use
timestamp-inode.  There are two reasons I can think of for this change: 1)
it makes the queue portable, which isn't very important, and 2) it makes
message identifiers which are valid for long periods of time.  The latter
makes it much easier to look through logs for a particular message.  It
shouldn't be much slower; it should only cost an extra time(2) call, as
you already need a stat to get the inode.

Just a suggestion.

> > It's not for speed - excepting speed of creating a unique filename.
> 
> I seem to recall the inode numbers biting people who were copying
> filesystems (backups, changing disks).  If your assertions are
> correct, wouln't it make some sense to come up with some other
> cheap unique filename?
> 
> -- 
> Brian 'you Bastard' Reichert          [EMAIL PROTECTED]
> 37 Crystal Ave. #303                  Current daytime number: (603)-434-6842
> Derry NH 03038-1713 USA                       Intel architecture: the left-hand path
> 

-- 
"Life is much too important to be taken seriously."
Thomas Erskine        <[EMAIL PROTECTED]>        (613) 998-2836

Reply via email to