PDA

View Full Version : 6.0.15 -problems with OutputLogFile


Yams
14-Aug-2008, 08:49 PM
procedure OpenLogFile;
...
if (Cached_LogFile = nil) then
begin
Opened_LogFile_Name := ExpandEnvVars(CurrentOptions.OutputLogFile(''));
Cached_LogFile := TLogFile.Create(Opened_LogFile_Name, False);
end;
end;

TEurekaModuleOptions.OutputLogFile
TEurekaModuleOptions.OutputFile
GetWorkingFile
IsFileOK
IsWritableFile:
...
HFile := CreateFile(PChar(FileName), GENERIC_WRITE or GENERIC_READ,
FILE_SHARE_READ or FILE_SHARE_WRITE, nil,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); // <- here
if (HFile <> INVALID_HANDLE_VALUE) then
...


If you set log file output path option to "%AppData%\MyAppsLogFiles" then you will have 2 problems:
1). Create file does not work with environment variables. You should expand variables earlier.
2). Folder %AppData%\MyAppsLogFiles obiosly does not exists. You should do ForceDirectories before call to IsFileOK.

As a workaround I must manually (in running program) initialize this option.

Yams
14-Aug-2008, 09:20 PM
Related:
http://news.eurekalog.com/showthread.php?t=2066

admin
22-Aug-2008, 11:27 AM
Hi,

I have just fixed this issue in the last 6.0.16 RC 5 version.

Try it and tell back to me your results, OK? :)

Yams (not home machine)
24-Aug-2008, 05:08 PM
Everything is cool now. Thanks.

admin
25-Aug-2008, 12:45 PM
Hi,

you're welcome! :)