name of tmpfile

Timothy Grant tjg at
Mon Mar 19 19:52:52 CET 2001

When I need to actually know the name of a tempfile, I do
things in two steps:

fn = tempfile.mktemp()
t = open(fn)

Then you can use fn anywhere you need the name.

On Mon, Mar 19, 2001 at 12:13:50PM -0500, Jonathan Soons wrote:
> I am trying to find out the real name of
> t = tempfile.TemporaryFile()
> so that I can do
> os.system('llp -d CHECKS -ofmt=checks <real_tempfile_name>')   # this is how
> I print to a printer
> According to the book, os.tmpfile() never gets a real name, so I can't use
> that.
> And p = tempfile.gettempprefix(t)
> is supposed to put a reference to the real name in p. So
> how do I pass the real name to os.system()?

Stand Fast,

Timothy Grant                         tjg at
Red Hat Certified Engineer  
Avalon Technology Group, Inc.         <><       (503) 246-3630
>>>>>>>>>>>>>Linux, because rebooting is *NOT* normal<<<<<<<<<
>>>>This machine was last rebooted:  61 days 23:06 hours ago<<

More information about the Python-list mailing list