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. problem with qftp

problem with qftp

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 5 Posters 2.2k 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.
  • ck_eeC Offline
    ck_eeC Offline
    ck_ee
    wrote on last edited by
    #1

    hi,

    i'm just testing around with qtftp in qt5.7. I've downloaded the sources and just included them into my project for testing. Everything builds fine but when i'm trying connectToHost(..) this error appears:

    "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open"

    The ftp object is only used in the qt event loop.

    Any ideas what the problem is?

    Thanks in advance.

    jsulmJ K J.HilkJ CoastFFC 4 Replies Last reply
    0
    • ck_eeC ck_ee

      hi,

      i'm just testing around with qtftp in qt5.7. I've downloaded the sources and just included them into my project for testing. Everything builds fine but when i'm trying connectToHost(..) this error appears:

      "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open"

      The ftp object is only used in the qt event loop.

      Any ideas what the problem is?

      Thanks in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @ck_ee Can you show your code?

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

      1 Reply Last reply
      1
      • ck_eeC ck_ee

        hi,

        i'm just testing around with qtftp in qt5.7. I've downloaded the sources and just included them into my project for testing. Everything builds fine but when i'm trying connectToHost(..) this error appears:

        "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open"

        The ftp object is only used in the qt event loop.

        Any ideas what the problem is?

        Thanks in advance.

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        @ck_ee

        First of all QFtp is deprecated. The source is only for compatibility of application based on previous version. The better is approach is using directly QNetworkAccessManager

        IMHO the message "device not open" is clear.
        Did you open the device?
        If so, did you check the response and the device has been really opened?

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        2
        • ck_eeC ck_ee

          hi,

          i'm just testing around with qtftp in qt5.7. I've downloaded the sources and just included them into my project for testing. Everything builds fine but when i'm trying connectToHost(..) this error appears:

          "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open"

          The ftp object is only used in the qt event loop.

          Any ideas what the problem is?

          Thanks in advance.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @ck_ee qftp is also incompatible with some ftp-severs, I run into that trying to connect to a WinCE FTP server

          I would suggest a 3-Party cross plattform FTP-lib, libcurl comes to mind


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          K 1 Reply Last reply
          2
          • J.HilkJ J.Hilk

            @ck_ee qftp is also incompatible with some ftp-severs, I run into that trying to connect to a WinCE FTP server

            I would suggest a 3-Party cross plattform FTP-lib, libcurl comes to mind

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @J.Hilk said in problem with qftp:

            @ck_ee qftp is also incompatible with some ftp-severs, I run into that trying to connect to a WinCE FTP server

            I would suggest a 3-Party cross plattform FTP-lib, libcurl comes to mind

            Interesting. Out of curiosity, did you do some investigations on this or simply switch to another lib?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @koahnig Ower supplier changed some of it's hardware, and told me proudly : "Everything is better, plus a new OS. WinCE".... :-(

              It was an old project, and I spend about a day trying to make it work with qftp. Than I switch to QNetworkAccessManager . The rudimentary push/get function that class offeres was enough in that particular case


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              0
              • ck_eeC ck_ee

                hi,

                i'm just testing around with qtftp in qt5.7. I've downloaded the sources and just included them into my project for testing. Everything builds fine but when i'm trying connectToHost(..) this error appears:

                "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open"

                The ftp object is only used in the qt event loop.

                Any ideas what the problem is?

                Thanks in advance.

                CoastFFC Offline
                CoastFFC Offline
                CoastFF
                wrote on last edited by
                #7

                @ck_ee
                I just got the same error message "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open", and search with Bing to find your post.
                not sure if you solved your problem already?
                as for me, after a struggle i finally solved mine.
                I use qt5.7.1 mingw, and download the QFtp src from github(qt5.7.1 doesn't intergrate with QFtp due to some bugs i guess), and build the ftp project, resulting in some .a,.dll,*.prl.
                I put the .dll into bin folder,.a and *.prl into lib folder.
                like, Qt5Ftp.dll and Qt5Ftpd.dll(debug version) in bin folder, libQt5Ftp.a and libQt5Ftpd.a(debug version) and Qt5Ftp.prl and Qt5Ftpd.prl in lib.

                I create a demo project, add QT += network in my .pro file and include the necessary <QFtp> in header file...
                things happen like this, I also add "LIBS+= d:\somepath\mingwfoler\lib\libQt5Ftp.a" in .pro file as for the project to link the qftp library.
                and when run my compiled demo project, it shows the error message "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open".

                i finally figure out what happend. because I use Debug Build to build the project first, which the LIBS should be added with "libQt5Ftpd.a"(Debug version) not "libQt5Ftp.a"(Release version), when change to libQtFtp5d.a, it works fine from now on.The other hand, when bulid release version, just change back to "libQt5Ftp.a"

                this is how my situation looks like, hope it can help someone .

                trying is the 1st step towards failure

                K 1 Reply Last reply
                0
                • CoastFFC CoastFF

                  @ck_ee
                  I just got the same error message "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open", and search with Bing to find your post.
                  not sure if you solved your problem already?
                  as for me, after a struggle i finally solved mine.
                  I use qt5.7.1 mingw, and download the QFtp src from github(qt5.7.1 doesn't intergrate with QFtp due to some bugs i guess), and build the ftp project, resulting in some .a,.dll,*.prl.
                  I put the .dll into bin folder,.a and *.prl into lib folder.
                  like, Qt5Ftp.dll and Qt5Ftpd.dll(debug version) in bin folder, libQt5Ftp.a and libQt5Ftpd.a(debug version) and Qt5Ftp.prl and Qt5Ftpd.prl in lib.

                  I create a demo project, add QT += network in my .pro file and include the necessary <QFtp> in header file...
                  things happen like this, I also add "LIBS+= d:\somepath\mingwfoler\lib\libQt5Ftp.a" in .pro file as for the project to link the qftp library.
                  and when run my compiled demo project, it shows the error message "QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open".

                  i finally figure out what happend. because I use Debug Build to build the project first, which the LIBS should be added with "libQt5Ftpd.a"(Debug version) not "libQt5Ftp.a"(Release version), when change to libQtFtp5d.a, it works fine from now on.The other hand, when bulid release version, just change back to "libQt5Ftp.a"

                  this is how my situation looks like, hope it can help someone .

                  K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  @CoastFF

                  Hi and welcome to devnet forum

                  QFtp has been deprecated. What you are using is some sort of replacement based on QNetworkAccessManager.
                  The question you might want to ask yourself is, if it is not better to go straight for QNetworkAccessManager.

                  Vote the answer(s) that helped you to solve your issue(s)

                  CoastFFC 1 Reply Last reply
                  2
                  • K koahnig

                    @CoastFF

                    Hi and welcome to devnet forum

                    QFtp has been deprecated. What you are using is some sort of replacement based on QNetworkAccessManager.
                    The question you might want to ask yourself is, if it is not better to go straight for QNetworkAccessManager.

                    CoastFFC Offline
                    CoastFFC Offline
                    CoastFF
                    wrote on last edited by
                    #9

                    @koahnig
                    I know it's deprecated, and QNetWorkAccessManeger is more efficient and more secure ,but QNetworkAccessManager doesn't have function like list,cd,remove,mkdir,rmdir,rename which Qftp can do after login into ftp server(or maybe I'm so dumb that i dont know QNetworkAccessManager can do).

                    trying is the 1st step towards failure

                    1 Reply Last reply
                    0

                    • Login

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