View Full Version : Difference a file and a directory
xgoan
11th August 2006, 11:55
Hi,
I'm doing a recursive function to load a list of files of a directory, how can I know if a item is a file or a directory?
Thanks
jacek
11th August 2006, 11:59
Everything is a file. ;)
QFileInfo::isDir() & Co.
jpn
11th August 2006, 12:00
I'm doing a recursive function to load a list of files of a directory, how can I know if a item is a file or a directory?
Presumably you are using QDir::entryList() (http://doc.trolltech.com/4.1/qdir.html#entryList)?
Try using QDir::entryInfoList() (http://doc.trolltech.com/4.1/qdir.html#entryInfoList) instead and then QFileInfo::isDir() (http://doc.trolltech.com/4.1/qfileinfo.html#isDir), QFileInfo::isFile() (http://doc.trolltech.com/4.1/qfileinfo.html#isFile)...
xgoan
11th August 2006, 12:02
Hehehe Thanks :)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.