Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TEMP files with tclkits

88 views
Skip to first unread message

mse...@gmail.com

unread,
Sep 27, 2016, 4:05:45 AM9/27/16
to
Hello,

I use a tclkit to distribute my application and one of our users has reported that each time he executes the application a directory (TCL00001928 or similar) is created in his C:\Users\USER\AppData\Local\Temp directory.

These directories are never removed and slowly fill up the disk.
In my code I have TDOM and do a 'package require' to load which also copies the tdomxx.dll into the temporary directory.

I tried overriding the load command to use a single private directory which worked for my dlls but not the original starkits, there is always a tclreg13.dll file.

Does anyone know why under windows these directories are not deleted after execution ?

In the tclWinLoad.c file there is a comment saying that this tmp directory should be set to autodelete, does anyone know why this is commented out or any other information about this system.

On Linux it seems the tmp directory is at least emptied when the system reboots, but as modern systems are rebooted less and less this too is a problem.

As a stopgap solution I have added the following line of code to all of our applications

# CLEANUP any old tmp directories
if {$tcl_platform(platform) eq "windows"} {
# Process all of the TMP directories
foreach dir [glob -directory $::env(TEMP) -type d TCL*] {
# Try and remove them windows will block any current applications
catch {file delete -force $dir}
}
}

Martyn

Paul Obermeier

unread,
Sep 27, 2016, 11:05:40 AM9/27/16
to
Hi Martyn,

you might take a look at the clt thread "Tclkits producing temporary
directories" from April this year.

https://groups.google.com/forum/#!searchin/comp.lang.tcl/Tclkits$20producing$20temporary$20directories%7Csort:relevance/comp.lang.tcl/ARI8Gglrjz8/5KCIKeUVMwAJ

I'm currently using a solution similar to yours, which works fine for me.

Paul

mse...@gmail.com

unread,
Sep 28, 2016, 5:07:45 AM9/28/16
to
On Tuesday, 27 September 2016 17:05:40 UTC+2, Paul Obermeier wrote:
> Hi Martyn,
>
> you might take a look at the clt thread "Tclkits producing temporary
> directories" from April this year.
>
> https://groups.google.com/forum/#!searchin/comp.lang.tcl/Tclkits$20producing$20temporary$20directories%7Csort:relevance/comp.lang.tcl/ARI8Gglrjz8/5KCIKeUVMwAJ
>
> I'm currently using a solution similar to yours, which works fine for me.
>
> Paul
>
> Am 27.09.2016 um 10:05 schrieb ms...gmail.com:
> > Hello,
> >
> > I use a tclkit to distribute my application and one of our users has reported that each time he executes the application a directory (TCL00001928 or similar) is created in his C:\Users\USER\AppData\Local\Temp directory.
> >
> > These directories are never removed and slowly fill up the disk.
> > In my code I have TDOM and do a 'package require' to load which also copies the tdomxx.dll into the temporary directory.
> >
> > I tried overriding the load command to use a single private directory which worked for my dlls but not the original starkits, there is always a tclreg13.dll file.
> >
> > Does anyone know why under windows these directories are not deleted after execution ?
> >
> > In the tclWinLoad.c file there is a comment saying that this tmp directory should be set to autodelete, does anyone know why this is commented out or any other information about this system.
> >
> > On Linux it seems the tmp directory is at least emptied when the system reboots, but as modern systems are rebooted less and less this too is a problem.
> >
> > As a stopgap solution I have added the following line of code to all of our applications
> >
> > # CLEANUP any old tmp directories
> > if {$tcl_platform(platform) eq "windows"} {
> > # Process all of the TMP directories
> > foreach dir [glob -directory $::env(TEMP) -type d TCL*] {
> > # Try and remove them windows will block any current applications
> > catch {file delete -force $dir}
> > }
> > }
> >
> > Martyn
> >

OK Thanks for the link. The difference is that I do the Cleanup at the start of execution.

Martyn
0 new messages