Results 1 to 3 of 3

Thread: Try to use QProcess

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    57
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Try to use QProcess

    Hi, I'm try to do a simple tool in QT; this tool convert files from dos format to unix format, using tr program

    The I use a QProcess to comunicate tr with my program, but I failed to make it work, because in the error output ( readAllStandardError() ) say:
    "usage: tr [-Ccsu] string1 string2
    tr [-Ccu] -d string1
    tr [-Ccu] -s string1
    tr [-Ccu] -ds string1 string2"

    and the files are not modified...

    What is my mistake??

    The statement I am trying to use is:

    tr -d "\015" < DOS_File

    The code is this:
    Qt Code:
    1. QString prg,file;
    2.  
    3. td = new QProcess(this);
    4.  
    5. prg = "tr -d \"\\015\" < " + file;
    6. td->start(prg);
    To copy to clipboard, switch view to plain text mode 

    I have also tried to use this:

    Qt Code:
    1. QString file;
    2.  
    3. td = new QProcess(this);
    4.  
    5. inst<< "-d"<<"\"\\015\""<<"<"<<file;
    6. td->start("tr",inst);
    To copy to clipboard, switch view to plain text mode 

    I'm use QT 4.6 in mac

    Thanks
    Last edited by avis_phoenix; 2nd August 2010 at 20:19. Reason: spelling corrections

Similar Threads

  1. Qprocess
    By ricky in forum Newbie
    Replies: 1
    Last Post: 3rd August 2009, 09:32
  2. QProcess inside QProcess
    By bunjee in forum Qt Programming
    Replies: 7
    Last Post: 4th December 2008, 00:39
  3. QProcess in qt-2.3
    By winarko in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 2nd July 2008, 21:58
  4. QProcess
    By agent007se in forum Newbie
    Replies: 10
    Last Post: 23rd July 2006, 01:11
  5. QProcess again ..
    By cmeliak in forum Qt Programming
    Replies: 13
    Last Post: 24th May 2006, 20:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.