Results 1 to 2 of 2

Thread: QDir mkpath

  1. #1
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDir mkpath

    Hello All,

    I'm trying to create a directory structure using the following code, but it sometimes fails, I would like to know why?
    Qt Code:
    1. QDir dir;
    2. bool ok = dir.mkpath(path); //this function creates the path, with all its necessary parents;
    3.  
    4. if(!ok)
    5. {
    6. //error message, could not create the required directory structure!
    7. QMessageBox::critical(this, tr("Error!"), tr("Error creating directory structure"));
    8. return;
    9. }
    To copy to clipboard, switch view to plain text mode 

    How can I get the reason for mkpath returning false, what is the function that I need to call to figure out what was the problem?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QDir mkpath

    Look at the value "path". I strongly think, your path is wrong/not well formated.

Similar Threads

  1. QDir Subclassing
    By Oleg in forum Qt Programming
    Replies: 9
    Last Post: 31st October 2007, 12:03
  2. QDir and QFile
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 27th September 2007, 13:43
  3. Is it me or QDir?
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 23:06
  4. mkpath error on Qt4.1.4
    By manhds in forum Qt Programming
    Replies: 2
    Last Post: 3rd August 2006, 12:34
  5. How to explicitely delete a QDir?
    By alan in forum Newbie
    Replies: 2
    Last Post: 13th February 2006, 17:48

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.