Boost logo

Boost Users :

From: matthias (matthias_at_[hidden])
Date: 2005-01-29 08:24:57


Hi,

I am currently writing a gtkmm component which acts as a file browser, much like
a small filemanager which can be embedded in gtkmm applications as a scrolled
window.

I have just rewritten the component to use the boost::filesystem classes instead
of the C functions for interacting with the filesystem.

However I am getting a strange error when I start my app: When iterating through
a directory I suddenly get the message: Aborted.

void FileBrowser::rebuild_file_list()
{
   namespace boostfs = boost::filesystem;

   boostfs::path cur_path( m_cur_dir );

   FileContainer tail; // m_files will first only contain directories,
                       // while tail will contain only files
   m_files.clear();

   try
   {
   boostfs::directory_iterator end;
   for( boostfs::directory_iterator dir( cur_path ); dir != end; ++dir )
   {
       std::cout << (*dir).string() << std::endl;
       if( boostfs::is_directory( *dir ) )
       m_files.push_back( *dir );
       else
       tail.push_back( *dir );
   }
   }
   catch( std::runtime_error & e )
   {
   std::cerr << e.what() << std::endl;
   }

   m_files.sort( SortedByName() );
   tail.sort( SortedByName() );

   drx::list_concat( m_files, tail );

}

OUTPUT:

[...]
/home/mkay/.acrobat
/home/mkay/.synce
/home/mkay/.gimp-2.0
/home/mkay/.fonts
/home/mkay/.designerrctb2
/home/mkay/.eclipse
/home/mkay/.gftp
/home/mkay/.ntrc_2
/home/mkay/.DCOPserver_anthrax__0
/home/mkay/.DCOPserver_anthrax_:0
/home/mkay/.kpackage
/home/mkay/.fonts.conf
/home/mkay/.xscreensaver
/home/mkay/xdefaults_old
/home/mkay/.reslisarc
/home/mkay/.aMule
/home/mkay/.gtkrc
Aborted

At this point the application exits.

Any idea what is causing this?

Thanks in advance,
Matthias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net