Results 1 to 20 of 20

Thread: How to remove empty folders?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: How to remove empty folders?

    very strange, I have run this code and it worked.

  2. #2
    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: How to remove empty folders?

    maybe you don't have permissions to remove dirs?

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: How to remove empty folders?

    Actually, When i create a new blank folder than it is able to remove ,If i open an existing directory which contains subdirs also using QFileDialog , then it wont able to remove..
    Always Believe in Urself
    Merry

  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: How to remove empty folders?

    maybe dir path is absolute?

  5. #5
    Join Date
    Jan 2007
    Posts
    326
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: How to remove empty folders?

    Yaa the dir path is absolute.
    Always Believe in Urself
    Merry

  6. #6
    Join Date
    Jan 2007
    Posts
    326
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: How to remove empty folders?

    If the path is absolute , then how can i remove direcctories..
    Always Believe in Urself
    Merry

  7. #7
    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: How to remove empty folders?

    can you show path and dirs structure?

  8. #8
    Join Date
    Jan 2007
    Posts
    326
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: How to remove empty folders?

    The Path is "/private/var/root/Desktop/Root"
    "/private/var/root/Desktop/Root/GIF"
    Always Believe in Urself
    Merry

  9. #9
    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: How to remove empty folders?

    looks like correct dir path.
    maybe dir has a rea-only files or it's read-only. did you check it?

  10. #10
    Join Date
    Jan 2007
    Posts
    326
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: How to remove empty folders?

    Yaa I check, the files are not read only, Files and dirs both are Read & Write.
    Always Believe in Urself
    Merry

  11. #11
    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: How to remove empty folders?

    I've just tested code from my post under Linux, it works fine.
    try to put qDebug() and output result of dir and files removing.

  12. #12
    Join Date
    Jan 2007
    Posts
    326
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    42
    Thanked 1 Time in 1 Post

    Default Re: How to remove empty folders?

    Yaa, When i run the code under Windows then it removes all the files and folders, and in MAC it remove all the files and also folders that are under root dir except the root dir,dont understand wat to do?
    Always Believe in Urself
    Merry

Similar Threads

  1. remove node in xml file
    By mattia in forum Newbie
    Replies: 1
    Last Post: 6th March 2008, 14:25
  2. remove directory empty or not empty
    By raphaelf in forum Newbie
    Replies: 12
    Last Post: 27th October 2006, 08:30
  3. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 09:58

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.