boost::filesystem: Aborted

M

Matthias

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?
 
M

Matthias

Matthias said:
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?

Anyone? I know it's not really on topic here but I didn't know whereelse
to ask. I have absolutely no idea what's going on there.
 
A

Andreas Huber

Matthias said:
Matthias said:
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?

Anyone? I know it's not really on topic here but I didn't know
whereelse to ask. I have absolutely no idea what's going on there.

Try the boost users list at

http://news.gmane.org/gmane.comp.lib.boost.user

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top