Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to capture stdout
Message
From
23/11/2006 12:31:47
 
 
To
22/11/2006 16:41:29
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01171891
Message ID:
01172100
Views:
17
>>>I use API_APPRUN class to run pg_dump.exe file
>>>
>>>I need to show the messages from it after it finishes.
>>>
>>>How to capture standard output and redirect it to file ?

>>
>>How about?
>>
>>pg_dump.exe > log.txt
>>
>>then you inspect log.txt?
>
>And in case we need to capture stderr as well, here's a neat trick I already forgot twice, and had to google it out again:
>
>pg_dump.exe > log.txt 2>err.txt

Thank you.
I forget to mention that I need need also:

1. Pass PGPASSWORD= environment variable to pg_dump (this seems to be the only way to pass password to pg_dump non-interactively). I modified APP_APPRUN to allow passing environment variables.

2. Capture exit code returned by pg_dump.exe to know that backup was completed OK.

How to implement those features ?
If this is not possible I think I can force user to enter password to run window and use some
IF ERRORLEVEL
statement to check for zero and non-zero errorlevel.
Do you have an example of checking errorlevel or idea how to pass password ?

Pg_dump.exe doc is here:

http://www.postgresql.org/docs/8.1/static/app-pgdump.html
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform