Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to Execute SCP command to transfer files to a target machine

How to Execute SCP command to transfer files to a target machine

Scheduled Pinned Locked Moved Unsolved General and Desktop
35 Posts 6 Posters 14.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M moyin
    16 Nov 2017, 13:09

    @jsulm i mentioned u already that, while debug if i put break point at or in readoutput() that will stop at break point so it means slot is not getting called.

    M Offline
    M Offline
    moyin
    wrote on 16 Nov 2017, 13:18 last edited by
    #22

    @moyin said in How to Execute SCP command to transfer files to a target machine:

    that will stop

    sorry correction "that will not stop at breakpoint"

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 16 Nov 2017, 13:19 last edited by
      #23

      @moyin said in How to Execute SCP command to transfer files to a target machine:

      proc.startDetached(command,params) ;

      Hm, startDetached() is a static call, so attaching any signals to it won't work, right? Shouldn't start() be used here instead? Just a thought, I have not analysed this code in-depth.

      (Z(:^

      1 Reply Last reply
      1
      • J jsulm
        16 Nov 2017, 13:06

        @moyin Then check whether these connects actually were successful:

        qDebug() << connect(&proc, SIGNAL(readyReadStandardError()), this, SLOT(readOutput()));
        qDebug() << connect(&proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readOutput()));
        

        Place a qDebug() in your readOutput() to print something out to see whether the slot is actually called.

        M Offline
        M Offline
        moyin
        wrote on 16 Nov 2017, 13:24 last edited by
        #24

        @jsulm its printing true for both

        qDebug() << connect(&proc, SIGNAL(readyReadStandardError()), this, SLOT(readOutput()));
        qDebug() << connect(&proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readOutput()));```
        
        qDebug() in readOutput() is not printing any thing.
        
        
        
        J 1 Reply Last reply 16 Nov 2017, 13:26
        0
        • M moyin
          16 Nov 2017, 13:24

          @jsulm its printing true for both

          qDebug() << connect(&proc, SIGNAL(readyReadStandardError()), this, SLOT(readOutput()));
          qDebug() << connect(&proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readOutput()));```
          
          qDebug() in readOutput() is not printing any thing.
          
          
          
          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 16 Nov 2017, 13:26 last edited by jsulm
          #25

          @moyin This is your problem:

          proc.startDetached(command,params) ;
          

          startDetached() is a static method! So you start your process, but it is not managed by the proc instance! Use start() instead:

          proc.start(command, params);
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply 16 Nov 2017, 13:40
          0
          • J jsulm
            16 Nov 2017, 13:26

            @moyin This is your problem:

            proc.startDetached(command,params) ;
            

            startDetached() is a static method! So you start your process, but it is not managed by the proc instance! Use start() instead:

            proc.start(command, params);
            
            M Offline
            M Offline
            moyin
            wrote on 16 Nov 2017, 13:40 last edited by
            #26

            @jsulm i tried that also but failed.

            J 1 Reply Last reply 16 Nov 2017, 13:58
            0
            • M moyin
              16 Nov 2017, 13:40

              @jsulm i tried that also but failed.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 16 Nov 2017, 13:58 last edited by
              #27

              @moyin In what way failed? Same issue? Slot still not called?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 3 Replies Last reply 16 Nov 2017, 14:53
              0
              • J jsulm
                16 Nov 2017, 13:58

                @moyin In what way failed? Same issue? Slot still not called?

                M Offline
                M Offline
                moyin
                wrote on 16 Nov 2017, 14:53 last edited by
                #28

                @jsulm sorry, failed in the sense not able to print the logs into textEdit.

                1 Reply Last reply
                0
                • J jsulm
                  16 Nov 2017, 13:58

                  @moyin In what way failed? Same issue? Slot still not called?

                  M Offline
                  M Offline
                  moyin
                  wrote on 16 Nov 2017, 15:02 last edited by
                  #29

                  @jsulm yes slot is not getting called itself.

                  1 Reply Last reply
                  0
                  • J jsulm
                    16 Nov 2017, 13:58

                    @moyin In what way failed? Same issue? Slot still not called?

                    M Offline
                    M Offline
                    moyin
                    wrote on 17 Nov 2017, 05:23 last edited by
                    #30

                    @jsulm
                    Slot still not called? Yes still not called.

                    J J 2 Replies Last reply 17 Nov 2017, 06:55
                    0
                    • M moyin
                      17 Nov 2017, 05:23

                      @jsulm
                      Slot still not called? Yes still not called.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 17 Nov 2017, 06:55 last edited by
                      #31

                      @moyin Can you post your current code?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • M moyin
                        17 Nov 2017, 05:23

                        @jsulm
                        Slot still not called? Yes still not called.

                        J Online
                        J Online
                        JonB
                        wrote on 17 Nov 2017, 08:07 last edited by
                        #32

                        @moyin
                        I'm lost as to where you're at.

                        But at least at one point you were told to use QProcess::startDetached() rather than QProcess:start(). I believe (untested by me, as usual, could be putting my neck on the line...) that you cannot properly redirect process input/output and/or get signals for input/output if you run the child process detached...?

                        J 1 Reply Last reply 17 Nov 2017, 09:37
                        0
                        • J JonB
                          17 Nov 2017, 08:07

                          @moyin
                          I'm lost as to where you're at.

                          But at least at one point you were told to use QProcess::startDetached() rather than QProcess:start(). I believe (untested by me, as usual, could be putting my neck on the line...) that you cannot properly redirect process input/output and/or get signals for input/output if you run the child process detached...?

                          J Offline
                          J Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 17 Nov 2017, 09:37 last edited by
                          #33

                          @JNBarchan This was already mentioned, but @moyin says that it isn't working even after changing to start().
                          There most be still something in the code, that's why I asked for the current code.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          J 1 Reply Last reply 17 Nov 2017, 09:49
                          0
                          • J jsulm
                            17 Nov 2017, 09:37

                            @JNBarchan This was already mentioned, but @moyin says that it isn't working even after changing to start().
                            There most be still something in the code, that's why I asked for the current code.

                            J Online
                            J Online
                            JonB
                            wrote on 17 Nov 2017, 09:49 last edited by JonB
                            #34

                            @jsulm
                            OK, as long he is not trying startDetached that's good...

                            FWIW, I happen to just be working on my own Dialog which spawns a sub-process (QProcess::start()), gets its output via signals, and copies it into scrolling text widget, and it's all working fine for me. As one would expect!

                            Purely BTW, given the command is an scp whose job is to copy the files, I wonder just what stdout/stderr output he is expecting? Has he informed us whether it's just the output that's missing/empty, or whether the whole command is not running in any case??

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              Mary M. Steele
                              Banned
                              wrote on 20 Feb 2020, 13:16 last edited by
                              #35
                              This post is deleted!
                              1 Reply Last reply
                              -1

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved