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. QProcess changes command behavior
Forum Updated to NodeBB v4.3 + New Features

QProcess changes command behavior

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 224 Views 3 Watching
  • 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.
  • ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on last edited by
    #1

    The following command works fine from a bash command line:

    /bin/udevadm info -q all -a /dev/mapper/almalinux_dev--almalinux9-root
    

    But when run using QProcess is returns the error

    Unknown device "/sys//dev/mapper/almalinux_dev--almalinux9-root": No such device
    

    so it would appear that somehow "/sys/" is being prepended to the path. But why? If it works from the command line shouldn't it work fine launched with QProcess? (The passed environment to QProcess is blank)

    I repeated the command from bash using "env -i" first and it runs fine with no environment specified. This seems very strange, but I confirmed the parameters passed to the QProcess are correct. I assume QProcess is doing something different when it launches the command...but what?

    Christian EhrlicherC 1 Reply Last reply
    0
    • ocgltdO ocgltd

      The following command works fine from a bash command line:

      /bin/udevadm info -q all -a /dev/mapper/almalinux_dev--almalinux9-root
      

      But when run using QProcess is returns the error

      Unknown device "/sys//dev/mapper/almalinux_dev--almalinux9-root": No such device
      

      so it would appear that somehow "/sys/" is being prepended to the path. But why? If it works from the command line shouldn't it work fine launched with QProcess? (The passed environment to QProcess is blank)

      I repeated the command from bash using "env -i" first and it runs fine with no environment specified. This seems very strange, but I confirmed the parameters passed to the QProcess are correct. I assume QProcess is doing something different when it launches the command...but what?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      QProcess only does what you tell them to do. It will not add anything. So please show us your code.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      S 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        QProcess only does what you tell them to do. It will not add anything. So please show us your code.

        S Offline
        S Offline
        SimonSchroeder
        wrote on last edited by
        #3

        @Christian-Ehrlicher is right. We need to see your code. Most of the time there is misunderstandings in how to provide command line parameters to QProcess.

        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