dircbm leaves many temporary files in %TEMP%
Moderators: Hacker, petermad, Stefan2, white
dircbm leaves many temporary files in %TEMP%
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?
What are these files for? Why aren't they deleted when they are no longer used?
Gruß. Claus
Explanation
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);
}
}
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
Kenchi
dircbm.ini
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?
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
dircbm
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.
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
Kenchi
debug
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.
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
Kenchi
Hi,
I have corrected the problem and released a new version under
http://sourceforge.net/projects/dircbm.
Greetings
Loo
I have corrected the problem and released a new version under
http://sourceforge.net/projects/dircbm.
Greetings
Loo