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 2 2060
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
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: perseus |
last post by:
It is really crazy! I need to use the Boost filesystem
for the manipulation of directories, and I have no idea how to
install this filesystem on my IBM-compatible machine.
Does anyone up here know...
|
by: Michael |
last post by:
Is this the correct place to ask about Boost libs?
If it is..............
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
using namespace boost;
using...
|
by: Steven T. Hatton |
last post by:
Anybody looked at this stuff?
http://www.boost.org/libs/filesystem/doc/index.htm
Most of it seems fairly straightforward. If you happen to do thing such as
put ~/code/c++/project in your...
|
by: jhasse |
last post by:
How can I create spaces with the create_directory() function?? When i
use this
boost::filesystem::create_directory("bla bla");
it throws. When I user
...
|
by: Daz |
last post by:
Hi everyone. I am not sure of where best to post this message.
I have spent 2 days now trying to answer this question to no avail, and
I am gradually reaching the end of my tether.
I am trying...
|
by: Daz |
last post by:
Hi Everyone.
I am sturggling trying to find out a way in which I can delete a 'path'
object. I may not need to delete it, however, I need to overwrite it.
The function I am trying to code,...
|
by: gfaraj |
last post by:
Has anyone tried to use Boost.Filesystem with C++/CLI? I'm trying to
get some code that worked correctly in my native application to work on
my C++/CLI program. The code is in a header file in a...
|
by: GaryE |
last post by:
Hello:
I am having trouble linking a couple of files using the boost::filesystem.
I am using MSVC 6.0.
Here is an abbreviated version of my problem:
foo.h:
#ifndef __FOO_
#define...
|
by: Javier |
last post by:
Hello all,
I'm trying to remove a hidden file (in UNIX) using the
Boost::filesystem library.
This is what I have:
#include <boost/filesystem/operations.hpp>
namespace...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |