Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Very strange: Process A started process B, B will fail to execute unzip command if A exited.

    General and Desktop
    3
    5
    1617
    Loading More Posts
    • 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.
    • Y
      yluo last edited by

      Process A start process B:
      @
      QStringList arguments;
      ...
      QProcess::startDetached("ProcessB", arguments );
      @
      B execute unzip command:
      @
      QStringList arguments;
      arguments<<source_zip_file;
      arguments<<"-d";
      arguments<<destination_path;
      QProcess::execute("unzip", arguments );
      @
      But if I execute rm command, it will success.
      @
      QStringList args;
      args<<"-drf";
      args<<destination_path;
      QProcess::execute("rm", args);
      @
      Any suggestion? Thanks!

      1 Reply Last reply Reply Quote 0
      • K
        koahnig last edited by

        welcome to devnet

        Did you also try to launch ProcessB with execute for unzip?

        Note: I have added code wrappings to your post. Please "use code wrappings":http://developer.qt.nokia.com/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 next time.

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

        1 Reply Last reply Reply Quote 0
        • Y
          yluo last edited by

          Hi, koahnig, thank you
          If launch ProcessB with execute, process A will not exited until process B exited, and process B will unzip successfully.
          My problem is if process A exited before process B, process B will fail to unzip.

          1 Reply Last reply Reply Quote 0
          • Y
            yluo last edited by

            Help!
            Help!!
            Help!!!

            1 Reply Last reply Reply Quote 0
            • T
              tobias.hunger last edited by

              Processes form a tree, axing away one does hurt its children. There is little you can do about that.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post