project BLF > class TDaemonUtility > method CreateDirectoryInternal
Parameters
| icDirectoryName | input | character | |
| ocError | output | character | |
| oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program1/tdaemonutility.p)
if index(icDirectoryName, "$ENVROOT") > 0
then do:
assign vhFcComponent = ?.
<M-1 run MainBlock () in XML>
<M-2 run ReadXMLNodeValue
(input search('server.xml') (icXMLFile),
input 'serverConfiguration' (icStartTag),
input 'ENVROOT' (icNodeTag),
output vcEnvRoot (ocNodeValue),
output viFcReturnSuper (oiReturnStatus)) in XML>
run gipr_DeleteProcedure in vhFcComponent.
delete procedure vhFcComponent.
assign vhFcComponent = ?
icDirectoryName = replace(icDirectoryName, "$ENVROOT", vcEnvRoot).
end.
if opsys = "WIN32"
then do:
/* Run utility supplied by Progress to create the directory */
run adecomm/_oscpath.p
(input icDirectoryName,
output viError).
if viError <> 0
then do:
run adecomm/_oserr.p (output ocError).
assign oiReturnStatus = -3.
end.
end.
else
if opsys = "UNIX"
then do:
/* Create directory based on adecomm/_oscpath.p but modified for unix */
assign icDirectoryName = replace(icDirectoryName, "~\", "/").
if substr(icDirectoryName, length(icDirectoryName, "CHARACTER"), 1, "CHARACTER") <> "/"
then assign icDirectoryName = icDirectoryName + "/".
assign viA = index(icDirectoryName, "/").
do while viA <> 0:
assign vcDummy = substr(icDirectoryName, 1, viA, "CHARACTER").
os-create-dir value(vcDummy).
if os-error <> 0
then do:
run adecomm/_oserr.p (output ocError).
assign oiReturnStatus = -3.
leave.
end.
assign viA = index(icDirectoryName, "/", viA + 1).
end.
/* Check if the folder is really there */
assign file-info:file-name = icDirectoryName.
if file-info:full-pathname = ?
then do:
assign ocError = trim(#T-3'An unexpected system error has occurred.':100(5167)T-3#)
oiReturnStatus = -98.
return.
end.
end.