[Zope-Coders] Help with Unit Testing

R. David Murray bitz@bitdance.com
Tue, 13 Aug 2002 08:41:23 -0400 (EDT)


On Tue, 13 Aug 2002, Chris Withers wrote:
> > You could create the skins in the tempfile area (though you'll have to be
> > careful to *not* delete immediately after creation, which is a standard
> > Unixism.)
>
> Huh? Lost me on the bit in brackets...

I think he meant that a common convention in unix programs is
to open the file in /tmp and then immediatly "delete it" (ie: unlink
it).  Because the file is still open, the creating program gets
to use it, but it is inivisible to the rest of the system.  And
as soon as the file is closed for whatever reason (close() call,
program crash) the disk blocks are freed for reuse.

So, he's saying, don't write your code that way in this case, presumably
because the whole reason you need the files in the first place
requires that they be visible on the file system during the test.

--RDM