Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

removing those OpenTemporary files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4608] removing those OpenTemporary files
  • From: hamlin_m at pa.msu.edu (Michael Hamlin)
  • Date: Wed, 21 Aug 1996 03:25:25 -0400
  • Organization: MSU Dept. of Physics & Astronomy
  • Sender: owner-wri-mathgroup at wolfram.com

I am using M'tica $Version = OpenVMS AXP 2.2 (September 14, 1994)
on our department Dec Alpha (obviously), and having this one
stumper (of many) problems.  Anyone who can help, please copy
the response to my email address, thank you!

The Problem:
mathematica jobs are creating lots of temporary files in my home 
directory, and then not deleting them when the session finishes.
These are not temporary files created by _my_ code, so they must be
created by system code; and consequently, I have no need to keep them
after the session has ended.
Since I have jobs running nearly continuously, and which take some 
considerable duration (therefore starting times are hard to establish
for the running jobs), I have trouble determining which temporary files 
belong to a _currently_ running session and which are old.  Therefore,
I am uneasy removing these temporary files by hand since I may disturb
and perhaps ruin a currently executing job.

A Possible Solution:
I want to alter the Close[ ] command to check before closing a stream:
if the stream is an OutputStream, and if the file associated with it was
opened using OpenTemporary (Instead of Open), then add the file's name
to a list FilesToRemove.  Then Quit[] or Exit[] should actually delete
the files listed in FilesToRemove.

Question:
- Why doesn't mathematica remove files created with OpenTemporary[] after
the session is ended?  If someone wanted to _save_ something for after the
session, they would open the file using the normal OpenWrite[] command.
(Or have I missed something?)
- How can I determine the filename associated with a stream, so that I can
attempt to rewrite the Close function?

Thanks for your attention.

				michael
				hamlin_m at pa.msu.edu

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: negative binomial distribution
  • Next by Date: Re: Compiled functions
  • Previous by thread: negative binomial distribution
  • Next by thread: If statement inside Do loop