Re: Alias & virtual in a directory?

From: (no name) (no email)
Date: Fri Feb 27 2004 - 11:49:22 EST


On Fri, 27 Feb 2004, Brian T. Allen wrote:

>
>
> Magnus Bäck wrote:
>
> >
> > With the way Postfix does it, all you need is a makefile. With GNU
> > make, it could look something like this:
> >
> > all: virtual.db
> >
> > virtual: $(glob *.whatever)
> > cat $^ > $@

Better (atomic and more secure):

virtual: $(global *.whatever)
        rm -f $@.tmp.*
        TMP=`mktemp $@.tmp.XXXXXX` && cat $^ > $TMP && mv $TMP $@

On systems without "mktemp", the directory permissions should be enough to
make use of a fixed temporary file name safe enough, with a low
probability risk of two simultaneous "make" commands stepping on each
other.

-- 
	Viktor.







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD