FileEnumertator::next_file() failed,why?
- From: "chunlong84" <chunlong84 gmail com>
- To: "gtkmm-list gnome org" <gtkmm-list gnome org>
- Subject: FileEnumertator::next_file() failed,why?
- Date: Tue, 9 Jun 2009 13:41:17 +0800
I use Gio::FileEnumerator to tranverse each file in a directory,but the call of FileEnumertator::next_file() failed during execution,why?
Glib::RefPtr<Gio::File> file=Gio::File::create_for_path ("./data");
Glib::RefPtr<Gio::FileEnumerator> fileEnum=file->enumerate_children();
Glib::RefPtr<Gio::FileInfo> fileInfo;
while((fileInfo=fileEnum->next_file())!=NULL) //failed
{
Glib::ustring filename="./data"+"/"+fileInfo->get_name();
Glib::ustring suffix=filename.substr(filename.size()-3,3);
if(suffix=="jpg" || suffix=="bmp" || suffix=="png")
filenameArray.push_back(filename);
}
gdb result:
glibmm-WARNING **: Failed to wrap object of type 'GLocalFileEnumerator'. Hint: this error is commonly caused by failing to call a library init() function.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6eda720 (LWP 13957)]
0xb761c2f4 in Gio::FileEnumerator::next_file () from /usr/lib/libgiomm-2.4.so.1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]