Results 1 to 10 of 10

Thread: Deleting a Folder

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 29 Times in 27 Posts

    Default Re: Deleting a Folder

    The problem is that your trying to delete you dir like this
    Qt Code:
    1. QDir::rmdir( dirListing[i]);
    To copy to clipboard, switch view to plain text mode 

    But rmdir is not static. What you should do is create QDir object (let say QDir dir) and then
    Qt Code:
    1. dir.rmdir(...);
    To copy to clipboard, switch view to plain text mode 
    I'm a rebel in the S.D.G.

  2. #2
    Join Date
    Jul 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: Deleting a Folder

    Why can't you use QProcess to remove the folder? This destroys the folder and everything in it.

    Qt Code:
    1. QProcess delfiles;
    2. delfiles.start("rm -R /folder/files");
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    9
    Thanked 3 Times in 3 Posts

    Default Re: Deleting a Folder

    well that's not going to work cross platform

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Deleting a Folder

    read this thread, maybe it should help you.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Avoiding unnecessary files and folder in Impelementation
    By salmanmanekia in forum Qt Programming
    Replies: 2
    Last Post: 30th May 2008, 14:54
  2. QFtp: entering deep folder (cd)
    By Raccoon29 in forum Newbie
    Replies: 1
    Last Post: 13th May 2008, 09:28
  3. Deleting QProcess
    By user_mail07 in forum Qt Programming
    Replies: 7
    Last Post: 29th January 2008, 18:55
  4. Replies: 2
    Last Post: 27th October 2007, 18:16
  5. [QT3] Temporary Folder Temporary File
    By Senpai in forum Qt Programming
    Replies: 10
    Last Post: 6th October 2006, 10:54

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.