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 in file name with space
Forum Updated to NodeBB v4.3 + New Features

problem in file name with space

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 802 Views 1 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.
  • S Offline
    S Offline
    saber
    wrote on last edited by
    #1

    hi in linux .
    i want pass a file name in qprosess .
    but file name with space is not exquting the command in qprosess.

    like this file path .file name has a space "new h"

    engrampa \"file:///home/shaber/Desktop/new h\" -d
    

    terminal add a "" in every space .how can i achieve that.
    i tried qurl .but % is not accepted by terminal.

    DiracsbracketD 1 Reply Last reply
    0
    • S saber

      hi in linux .
      i want pass a file name in qprosess .
      but file name with space is not exquting the command in qprosess.

      like this file path .file name has a space "new h"

      engrampa \"file:///home/shaber/Desktop/new h\" -d
      

      terminal add a "" in every space .how can i achieve that.
      i tried qurl .but % is not accepted by terminal.

      DiracsbracketD Offline
      DiracsbracketD Offline
      Diracsbracket
      wrote on last edited by Diracsbracket
      #2

      @saber said in problem in file name with space:

      engrampa "file:///home/shaber/Desktop/new h" -d

      Does using single quotes work?

      engrampa '/home/shaber/Desktop/new h' -d
      
      1 Reply Last reply
      1
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        QProcess will handle this for you. Just pass the arguments to QProcess correctly with setArguments and the rest is done for you.

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

        DiracsbracketD 1 Reply Last reply
        3
        • Christian EhrlicherC Christian Ehrlicher

          QProcess will handle this for you. Just pass the arguments to QProcess correctly with setArguments and the rest is done for you.

          DiracsbracketD Offline
          DiracsbracketD Offline
          Diracsbracket
          wrote on last edited by
          #4

          @Christian-Ehrlicher said in problem in file name with space:

          Just pass the arguments to QProcess correctly with setArguments and the rest is done for you.

          Hi, to be fair, I have never used QProcess myself, but for @saber, could you show how to apply it for his/her specific example above?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Something like:

            QProcess process;
            QStringList arguments{"file:///home/saver/Desktop/new h/", "-d"};
            process.start("engrampa", arguments);
            

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            4

            • Login

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