Results 1 to 3 of 3

Thread: directory and files

  1. #1
    Join Date
    Jun 2007
    Location
    italy
    Posts
    126
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question directory and files

    Hi all,

    How can I check with Qt if a directory has files and in that case delete all those files ?
    I am using Qt 4..

    Thank you in advance for your kind reply and suggestions..

    Roberto

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: directory and files

    You can iterate over a directory using QDir::entryInfoList .
    You can then check if each is a file, and if yes, delete it.

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

    Default Re: directory and files

    I'm a rebel in the S.D.G.

Similar Threads

  1. Count files of a directory
    By radu_d in forum Qt Programming
    Replies: 6
    Last Post: 27th March 2012, 03:17
  2. How to search files wihin directory and it's subdirectory
    By Deepak Mishra in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2007, 11:54
  3. trace new files in a directory
    By Fastman in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 12:04
  4. [QT4] Counting files in a directory (Linux)
    By ucntcme in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2007, 22:59
  5. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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.