Results 1 to 3 of 3

Thread: QDir not working as expected

  1. #1
    Join Date
    Jun 2011
    Posts
    17
    Qt products
    Qt3
    Platforms
    MacOS X

    Default QDir not working as expected

    This is what I have been doing, the directory does exist but then the folder is never created by the mkdir functions. Maybe I am missing something trivial but I cannot seem to find many examples on this using QDir.

    pathname = C:\Documents and Settings\wrightc\Desktop\TESTS
    folder = Test*_Results;

    QDir directory(QString::fromStdString(pathname));
    if(directory.exists()){
    directory.mkdir(QString::fromStdString(folder));
    }

  2. #2
    Join Date
    Sep 2008
    Location
    Poland
    Posts
    80
    Thanks
    4
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QDir not working as expected

    Quote Originally Posted by BettaUseYoNikes View Post
    Maybe I am missing something trivial(...)
    Yes,you are.
    Use / instead of \
    And * is illegal character for a filename on Windows

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,356
    Thanks
    3
    Thanked 5,010 Times in 4,789 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Blog Entries
    4
    Wiki edits
    10

    Default Re: QDir not working as expected

    Does your filesystem accept "*" as part of directory name?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QWebElement setAttribute not working as expected
    By pherthyl in forum Qt Programming
    Replies: 2
    Last Post: 12th April 2011, 07:17
  2. Replies: 2
    Last Post: 22nd December 2010, 10:37
  3. Replies: 0
    Last Post: 17th August 2010, 14:37
  4. QTableView not working as expected.
    By junxuan in forum Qt Programming
    Replies: 7
    Last Post: 30th July 2009, 08:17
  5. QDir::setNameFilters not working, bug?
    By saugumas in forum Qt Programming
    Replies: 3
    Last Post: 20th May 2008, 18:33

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.