project BLF > class TDaemonUtility > method GetDaemonLogFileInternal
Parameters
icDaemonName | input | character | |
ocFileName | output | character | |
omFileContent | output | memptr | |
ocErrorMessage | output | character | |
oiReturnStatus | output | integer | |
Internal usage
BLF
program code (program1/tdaemonutility.p)
<Q-57 run DaemonInfo (all) (Read) (NoCache)
(input 0, (DaemonId)
input icDaemonName, (DaemonName)
input '', (DaemonStatus)
input '', (DaemonStatusDiffersFrom)
output dataset tqDaemonInfo) in BBaseDaemon>
find first tqDaemonInfo where tqDaemonInfo.tcDaemonName = icDaemonName no-error.
if available tqDaemonInfo
then do:
/* the query itself replaces $ENVROOT */
file-info:file-name = tqDaemonInfo.tcDaemonLogFile.
if file-info:file-type = ?
or file-info:file-type begins "D"
then do:
ocErrorMessage = replace (#T-26'File not found: $1.':100(17)T-26#, "$1", tqDaemonInfo.tcDaemonLogFile).
oiReturnStatus = -3.
return.
end.
ocFileName = file-info:full-pathname.
copy-lob from file file-info:full-pathname to omFileContent no-error.
if error-status:error
then do:
oiReturnStatus = -3.
do viA = 1 to error-status:num-messages:
ocErrorMessage = ocErrorMessage + error-status:get-message(viA) + chr(10).
end.
end.
end.
else assign oiReturnStatus = -3
ocErrorMessage = substitute (#T-92'Unable to find the daemon based on its name (&1).':255(33)T-92#,icDaemonName).