Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rcp command

Status
Not open for further replies.

MichelleButler

IS-IT--Management
Apr 5, 2002
73
GB
During a report run I would like the user to have a option to send the file to the printer or to a file. I would also like to be able to get the file to be copied to the user directory, does anybody know if this is possible. I looked into using the rcp command within the 4gl coding.

Many thanks

Michelle
 
Michelle:

From within native Informix 4GL, you can execute any valid Unix command, but the return values are limited. This example rcp's file /tmp/tx from the current server to the e4dc server:

main

define
scratch char(80),
ret_int integer

let scratch = "rcp /tmp/tx e4dc:/tmp"
run scratch returning ret_int

if ret_int != 0
then
display "error"
end if

end main

If the command fails for some reason a non zero code returns to the calling program.

4GL is poor when comes to interacting with the OS. I've posted a FAQ in Informix Online forum which discusses interfacing "C" functions to access the OS. Even with my FAQ, the learning curve could be a little steep, but it might be worth investigating.

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top