Operating System - OpenVMS
1752803 Members
5727 Online
108789 Solutions
New Discussion юеВ

Re: Looking for help:How to let a process write output to a file?

 
SOLVED
Go to solution
Z.K.
Frequent Advisor

Re: Looking for help:How to let a process write output to a file?

Thanks John,
I did learn a lot from your reply.
My main objective is to start the process which will do some job (like backup,delete old backups,etc. using function int system(char *string))periodically,and write the execution logs into a disk file.But all I got was neither the job done nor the logs written in the disk file I specified.Someone told me the quotas caused the failure,but I don't know what quotas should I change to make it success.
Martin Vorlaender
Honored Contributor

Re: Looking for help:How to let a process write output to a file?

Z.K.,

you could try http://vms.pdv-systeme.de/users/martinv/quota_monitor.com to watch the process quotas, to find the one that eventually hits the ceiling.

HTH,
Martin
Joseph Huber_1
Honored Contributor
Solution

Re: Looking for help:How to let a process write output to a file?

Quickly scanning the code, I see a main reason why You see nothing:

the process created is running an image and HAS NO CLI (DCL).
So a "system(somecommand);" call simply fails. And if the process which does this is not checking the status and writes a message, nothing is written at all.

You have to create a process running the image
SYS$SYSTEM:LOGINOUT.EXE, and specify as input some DCL command-file which runs your image, and the logfile as sys$output and sys$error.
http://www.mpp.mpg.de/~huber
Z.K.
Frequent Advisor

Re: Looking for help:How to let a process write output to a file?

Ian,
>> because the C complier naturally aligns structures and the quota structure is not you need
pragma member_alignment save
#pragma nomember_alignment
...
#pragma member_alignment restore

I did specified these lines for the quota structure.

In the "OpenVMS System Services Reference Manual", I found the input parameter specifies an "Equivalence name to be associated with the logical name SYS$INPUT in the
logical name table of the created process".I used to set the "image" parameter for the image I want to start as a process,not sys$system:loginout.exe.

Seems Joseph resolved my question.
Thank John,Ian,Martin and Joseph!
Thank everyone!