Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to capture stdout
Message
De
23/11/2006 12:31:47
 
 
À
22/11/2006 16:41:29
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01171891
Message ID:
01172100
Vues:
18
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform