Results 1 to 2 of 2

Thread: fprintf and QProcess problem

  1. #1
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default fprintf and QProcess problem

    Hi I'm quite new to QT programming so I'm puzzled over a few things while coding. I'm currently using Fedora 10.

    1. How do I fprintf output to a file in the other folder? I know how save to a file in the same dir as the program. It seems like fopen doesn't accept a path to the other folder?

    2. I have a script in c++, which was coded using codeblock and the .exe is located inside bin/debug, different folder with my Qt gui interface. In the Qt gui interface, after a trigger on the pushbutton, I want to run the script in terminal, and output to the display in the Qt gui interface. but after
    QProcess* proc = new QProcess;
    proc->start("/home/username/Desktop/testfile/bin/Debug/testfile");
    I can't seems to run it,
    So I tried the script by execute ./testfile in terminal, it did run. What could be the problem?

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: fprintf and QProcess problem

    fopen() takes a complete path. If it fails to open the file specified, it may be that the path is wrong, or that permissions are wrong. If fopen() returns a NULL pointer, immediately check errno for more information on the cause of the failure.See also perror().

Similar Threads

  1. QProcess problem
    By Mystical Groovy in forum Qt Programming
    Replies: 2
    Last Post: 2nd December 2008, 20:07
  2. about fprintf
    By alban_gt in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th September 2008, 13:39
  3. Problem with QProcess
    By ms20020048 in forum Qt Programming
    Replies: 1
    Last Post: 11th May 2007, 20:03
  4. reading fprintf statements from console in qt
    By KrishnaKishan in forum Qt Programming
    Replies: 2
    Last Post: 15th March 2007, 10:00
  5. Qt4 QProcess Problem
    By qleutes in forum Qt Programming
    Replies: 10
    Last Post: 23rd January 2006, 09:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.