Don't forget the equally important "host" stamp on the file. That allows you to write two different files at precisely the same time on a shared filesystem (e.g., NFS) with no race conditions.
On Tuesday, 21 October, 2003 13:37, Andrew Kohlsmith wrote: > > There is a C Library function that will return a unique > > file name. (see man mkstemp) > > That's the best way to go. It is generally a > > bad design to encode any information in a file name. Better to > > simply use the file's date/time stamp to order the messages. > > I was speaking with tclark on IRC about this this past weekend. > > What is wrong with using Maildir/ type interfaces for voicemail? > > Maildir is a very straightforward, scalable and distributable way of > storing things like email (and voicemail). Each mailbox has this format: > > ./ > tmp/ > cur/ > new/ > > When a new voicemail is created, you mkstemp in tmp/ and create the file. > Once it's done, you mv it to /new. When it's listened to or otherwise > accessed, it's mv'd to cur where it stays until deletion. > > So to recap: create and manipulate in tmp/, move to new/ once done. When > no longer new, move to cur/ and leave there. No funky locking, totally NFS > safe and very fast, since each voicemail is just a file. > > There's no patents or any kind of software encumberances to this technique, > either. > > Regards, > Andrew > _______________________________________________ > Asterisk-Users mailing list > [EMAIL PROTECTED] > http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
