By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,657 Members | 1,029 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,657 IT Pros & Developers. It's quick & easy.

boost::filesystem: Aborted

P: n/a
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?

--
Regards,
Matthias
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Matthias wrote:
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.

--
Regards,
Matthias
Jul 23 '05 #2

P: n/a
Matthias wrote:
Matthias wrote:
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,

--
Andreas Huber

When replying by private email, please remove the words spam and trap
from the address shown in the header.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.