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. Very strange: Process A started process B, B will fail to execute unzip command if A exited.
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.8k 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.
  • Y Offline
    Y Offline
    yluo
    wrote on last edited by
    #1

    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
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      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
      0
      • Y Offline
        Y Offline
        yluo
        wrote on last edited by
        #3

        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
        0
        • Y Offline
          Y Offline
          yluo
          wrote on last edited by
          #4

          Help!
          Help!!
          Help!!!

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tobias.hunger
            wrote on last edited by
            #5

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

            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