10000 Temp file limit

399 views
Skip to first unread message

college.atlas

unread,
Sep 12, 2008, 3:02:41 AM9/12/08
to MapInfo-L
Thought I'd share a recent discovery that drove me mad today.

I'd written a mapbasic script that did a few things that are
essentially mundane. Nothing tricky at all.

It worked great and so I shared it with a colleague. Then it all went
wrong. At a certain point in the code (a query) Mapinfo stopped dead,
forcing a Task End on Mapinfo.

I asked for the MI Table and ran it on my system. It stopped on my
system at the same point. I tried the sample MI Table file. This too
failed.

Perplexed I created a simple table and tried to run the query
"manually" through Mapinfo. This also caused Mapinfo to stop. I
started thinking Mapinfo had become corrupted. Uninstlled re-instlled.
Still no good.

Thought virus. No.

Called a friend at Mapinfo (very helpful).

Turns out when Mapinfo does a query it creates a TMP file in the
c:\Documents and Settings\<user>\Local Settings\Temp directory as
~MAPXXXX.TMP

Apparently if you reach ~MAP9999.TMP Mapinfo stops dead.

Theoretically MI should clean these up. However another gem provided
by my contact is there may be a tie up with Symantec Anti Virus.

I'm familiar with this sort of thing. The possiblility exists that
when MI goes to clean up the TMP files Symantec has locked the file to
check and see if there is a Virus on it. This is the "Auto Protect"
mode for SAV. Any file you or the system touches gets swept for
viruses.

Manually cleaning out the the 9999 temp files got MI up and running
again on both systems.

I'll track the progress and see how it goes.

Bill Thoen

unread,
Sep 12, 2008, 4:04:57 AM9/12/08
to mapi...@googlegroups.com
college.atlas wrote:
> Turns out when Mapinfo does a query it creates a TMP file in the
> c:\Documents and Settings\<user>\Local Settings\Temp directory as
> ~MAPXXXX.TMP
>
> Apparently if you reach ~MAP9999.TMP Mapinfo stops dead.
One way to avoid this in MapBasic is to always write your queries to
named tables and close them afterwards. For example:

Select * from MyTable

creates a table called QueryN, where N is some number. If you don't
close this when you're done then these temporary tables build up. A
better technique is to do something like this:

Select * from MyTable Into TMP

and when you're done with it:

Close Table TMP

This way you've got a bit more control over what's active in the MapInfo
environment and you never run afoul of that temp file limit.

Interesting observation on Symantec AV, though.

- Bill Thoen

college.atlas

unread,
Sep 12, 2008, 7:40:41 AM9/12/08
to MapInfo-L
Thanks Bill.

After I found out what the issue was I did as you suggested.

Can't remember reading anywhere in any Mapbasic manuals about this
"good programming practice".

I've experienced the Symantec AV in other areas like automated backup
systems where you have to omit entire directories to ensure SAV
doesn't foul up the backup regime by locking the file you're reading
from or writing to.

So it's not too much of a stretch to imagine the same thing happeing
with Mapinfo temp files. That might also explain why my temp directory
is full of temp files from other applications as well.

Kent.T...@state.mn.us

unread,
Sep 12, 2008, 9:54:47 AM9/12/08
to mapi...@googlegroups.com

I can't comment on "good programming practice", but I think that creating a temp folder under C:\ should fall under "good computing practice".  Not all applications will use this folder but most will.  It saves time trying to find the folder under the Windows default "C:\Documents and Settings\username\Application Data".  You can specify this under the System Properties-Advanced tab-Environment Variables.  It is a throwback from the days of DOS and autoexec.bat but I still find it useful.
____________
Kent Treichel
GIS Analyst
Tax Research
Minnesota Department of Revenue
MS 2230
600 North Robert St
St. Paul, MN 55146-2230
651-556-6150
fax 651-556-3103




"college.atlas" <colleg...@gmail.com>     09/12/2008 06:40 AM
Sent by: mapi...@googlegroups.com
Please respond to: mapi...@googlegroups.com

To
MapInfo-L <mapi...@googlegroups.com>
cc
Subject
[MI-L] Re: 10000 Temp file limit


Reply all
Reply to author
Forward
0 new messages