name of tmpfile
Timothy Grant
tjg at exceptionalminds.com
Mon Mar 19 13:52:52 EST 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,
tjg.
Timothy Grant tjg at exceptionalminds.com
Red Hat Certified Engineer www.exceptionalminds.com
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