return value

return value

Post by Igo » Sun, 15 Oct 2000 04:00:00



Hi  All

Does somebody use  NcFTPGet?
How can I get a return value from this utility?
I would like to use it in a script

Thanks

Igor

 
 
 

return value

Post by Mark Jeffcoa » Sun, 15 Oct 2000 04:00:00



> Does somebody use  NcFTPGet?
> How can I get a return value from this utility?
> I would like to use it in a script

man ncftpget:
[...]
DIAGNOSTICS
       ncftpget returns the following exit values:

       0       Success.

       1       Could not connect to remote host.

       2       Could not connect to remote host - timed out.

       3       Transfer failed.

And eight more...

--
Mark Jeffcoat

 
 
 

1. Default return value for when return() is not explicitly used on SC5.0

I wrote the routine below to test some code in one of our
applications. This snippet exactly mirrors what is happening in our
real code. It was compiled on a sun-4 ultra platfrom using SC5.0 under
Solaris 5.6. If I pass the integer value of 2 as the first arguement
then control falls through the switch statement, and out of the
routine without explicitly returning any value. The compiler does not
report this as either a warning or an error. So far I have not been
unable to find anywhere in the documentation that specifies what the
return value from a routine will be if it is not explicitly given a
value to return. In my test, I wrote a short main to pass the values
(1,1), (1,2), and(2,1) to switchTest(int, int). The first 2 calls
returned the predictable results of TRUE and FALSE. The third call
also returned a FALSE, but that does not satisfy me that the return
value will always be FALSE.

bool switchTest(int num, int num2)
{
  switch(num) {
    case 1:
      switch(num2) {
      case 1:
        printf("CASE 1: Num = %d, Num2 = %d\n", num, num2);
        return(TRUE);
        break;
      default:
        printf("DEFAULT CASE: Num = %d, Num2 = %d\n", num, num2);
        return(FALSE);
      }
  }

Does anybody have the precise information on what the behaviour for
this compiler is defined to be for this situation?

Nick

2. jumpstart solaris from a linux station

3. reliability of ftp return value

4. Req help-----Caldera desktop2.4 freezes after a while ? Tried 3x reinstsalls.

5. Analyzing return value

6. Perfmeter Question on DISK

7. Return Value 255 in Shells

8. Performance collecting tools

9. getting the return value of a command executed on another host

10. Returning values to a shell script?

11. hard_start_transmit return value and oops

12. returning value from PL/SQL block

13. return value from script to C