Sign in to follow this  
Followers 0
Jango

Problem with StdoutRead

2 posts in this topic

Hello,

I'm using PSFTP.EXE to send/receive files to/from SFTP Server and i would like to show the result in a window but it does'nt work, here is my code:

Func SFTP_Execute($sHOST, $sPORT, $sUSER, $sPWD, $sFILE)
    Local $stdout, $rc
;InputBox("", "", "PSFTP " & $sHOST & " -P " & $sPORT & " -l " & $sUSER & " -pw " & $sPWD)
    $rc = Run("PSFTP " & $sHOST & " -P " & $sPORT & " -l " & $sUSER & " -pw " & $sPWD & " -b " & $sFILE, @ScriptDir, @SW_HIDE, $STDOUT_CHILD)
    While ProcessExists($rc)
        If StdoutRead($rc, 0, True) > 0 Then
            $stdout &= StdoutRead($rc)
        EndIf
        Sleep(1000)
    WEnd
    If StdoutRead($rc, 0, True) > 0 Then
        $stdout &= StdoutRead($rc)
    EndIf
    Return $stdout
EndFunc

What's wrong with StdoutRead ?

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0