Results 1 to 4 of 4

Thread: How to create directories??

  1. #1
    Join Date
    Mar 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to create directories??

    Hi.

    My application needs some subfolders to put logfiles ecc...

    Is there a way to create the folders by some functions in the code or I have to create them by mean of the MakeFile?If yes what I've to add to the makefile generated with qmake.I tried with something like:

    createDir: $(CHK_DIR_EXISTS) directoryName
    $(MKDIR) directoryName

    but it doesn't work.I supposed it's totally wrong so anyone could help me?Thanks a lot.

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

    Default Re: How to create directories??

    Try QDir::mkdir() or QDir::mkpath().

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create directories??

    Quote Originally Posted by paranoid_android
    Is there a way to create the folders by some functions in the code or I have to create them by mean of the MakeFile?
    Use QDir::mkdir() or QDir::mkpath().

    Quote Originally Posted by paranoid_android
    If yes what I've to add to the makefile generated with qmake.I tried with something like:
    It should be:
    Qt Code:
    1. directoryName:
    2. $(MKDIR) directoryName
    To copy to clipboard, switch view to plain text mode 
    You also have to add "directoryName" somewhere as a dependency. Like:
    Qt Code:
    1. all: ... directoryName ...
    2. ...
    To copy to clipboard, switch view to plain text mode 
    But remember that qmake will overwrite your Makefile.

  4. #4
    Join Date
    Mar 2006
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create directories??

    Thank you very much.I'll try with QDir

Similar Threads

  1. Why do some QWidgets create own threads?
    By donglebob in forum Qt Programming
    Replies: 5
    Last Post: 6th July 2010, 17:01
  2. Replies: 0
    Last Post: 5th February 2009, 23:41
  3. Cannot create MySQL stored procedure / views from Qt
    By pshah.mumbai in forum Qt Programming
    Replies: 8
    Last Post: 8th October 2008, 16:22
  4. What is the best way to create a file management panel?
    By DIMEDROLL in forum Qt Programming
    Replies: 0
    Last Post: 24th September 2008, 08:49
  5. How to create an Insert/Submit button for a form.
    By fnmblot in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2006, 16:18

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.