dircbm leaves many temporary files in %TEMP%

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
creibens
Junior Member
Junior Member
Posts: 25
Joined: 2004-09-13, 08:20 UTC
Location: Ronnenberg-Benthe

dircbm leaves many temporary files in %TEMP%

Post by *creibens »

I found a bad bug in dircbm: Whenever I open a D64-File (from which I have many), dircbm leaves a bunch of temporary files in the %TEMP% directory. The names are all of the form looXXXX.tmp, where XXXX is a hexadecimal number of up to 4 digits, and all these files are empty. Within a few hours, I reached to have more than 65,500 of these files, which suddenly stopped TotalCommander from reacting, when I tried to open another D64 file. It took some hours (!) to identify these files as the reason for this and to identify dircbm as the creator of these files.

What are these files for? Why aren't they deleted when they are no longer used?
Gruß. Claus
kenchis
Junior Member
Junior Member
Posts: 53
Joined: 2006-02-04, 11:44 UTC
Location: Berlin
Contact:

Explanation

Post by *kenchis »

Hi Claus,
i had a look in the source code of that plugin and i found out, that it is a debug log file.
If there is a dircbm.ini containing a section like that:
=======SNIP====
[COMMON]
LOGGING=1
=======SNAP====
If there is a value != 0 (like in the example) it writes log messages to temp directory

Kind Regards
Kenchis

P.S.
There is a Java re-implementation of that plugin
in alpha state at [http://www.totalcmd.net/plugring/tc_java.html]

Here is the C-code responsible of that behaviour:



void determineIniAndLogFile(FILE **fdLog, char *logFile)
{
char path [MAX_PATH];
int rc;

// get windows directory
rc = GetTempPath(MAX_PATH-1, path);
sprintf(iniFile, "%s\\dircbm.ini", path);
// sprintf(logFile, "%s\\dircbm_%d.log", buffer, time(NULL));

rc = GetTempFileName(path, "loo", 0, logFile);

// get state of logging in ini file if available
if (*fdLog == NULL)
{
debugSwitch = GetPrivateProfileInt("common", "logging", FALSE, "dircbm.ini");

IFDEBUG *fdLog = fopen (logFile, "wt");
IFDEBUG setbuf(*fdLog, NULL);
}
}
Gruß,
Kenchi
User avatar
creibens
Junior Member
Junior Member
Posts: 25
Joined: 2004-09-13, 08:20 UTC
Location: Ronnenberg-Benthe

dircbm.ini

Post by *creibens »

Hi Kenchi,

sorry for my late reaction - due to an error in my profile, I wasn't informed about your answer.

I checked my system and found no DIRCBM.INI file or any other .INI file containing such a section. Should I create one? Where?
Gruß. Claus
kenchis
Junior Member
Junior Member
Posts: 53
Joined: 2006-02-04, 11:44 UTC
Location: Berlin
Contact:

dircbm

Post by *kenchis »

Hallo Klaus,

also nach der Quelle zu urteilen:
// get windows directory
GetTempPath()

sollte bei dir bereits eine INI Datei vorhanden sein.
Laut Microsoft wird dann wie folgt nach einem temporären Verzeichnis gesucht.

The path specified by the TMP environment variable.
The path specified by the TEMP environment variable.
The path specified by the USERPROFILE environment variable.
The Windows directory.

Damit muesstest du die Datei "dircbm.ini" finden.
Gruß,
Kenchi
User avatar
creibens
Junior Member
Junior Member
Posts: 25
Joined: 2004-09-13, 08:20 UTC
Location: Ronnenberg-Benthe

Post by *creibens »

Ich heiße nicht Klaus, sondern Claus :-)

Es gibt auf meinem Rechner definitiv keine dircbm.ini. Ich habe alle Festplatten vom Total Commander durchsuchen lassen.

Wo die temporären Dateien auf meinem Rechner liegen, ist mir bekannt. Dort fand ich ja auch die vielen loo*.tmp-Dateien.
Gruß. Claus
kenchis
Junior Member
Junior Member
Posts: 53
Joined: 2006-02-04, 11:44 UTC
Location: Berlin
Contact:

debug

Post by *kenchis »

Also Claus,

das plugin geht jedenfalls davon aus, das die Konfigurationsdatei den debug eingeschaltet hat.
Vielleicht solltest du das mal debuggen, falls du die entsprechende Software hast. Der Source Code ist ja verfügbar.
Gruß,
Kenchi
loo
Junior Member
Junior Member
Posts: 21
Joined: 2004-01-23, 22:30 UTC

Post by *loo »

Hi,

I was able to reproduce the problem and will take a closer look a that.

Greetings
Loo
loo
Junior Member
Junior Member
Posts: 21
Joined: 2004-01-23, 22:30 UTC

Post by *loo »

Hi,

I have corrected the problem and released a new version under
http://sourceforge.net/projects/dircbm.

Greetings
Loo
Post Reply