473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

deleting a boost::filesystem::path object

Daz
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, converts a string into a 'path'
object, then checks to see if it exists. If it doesn't exist, the path
object needs to be reused and the new path string put into it (not
appended to it).

If anyone could help, or point out where I can find this information,
it would be very much appreciated. I have tried looking on boost.org,
but get lost in all the jargon and can't seem to find what I am looking
for.

Thanks in advance.

Daz

May 13 '06 #1
8 2964
Daz wrote:
If anyone could help, or point out where I can find this information,
it would be very much appreciated. I have tried looking on boost.org,
but get lost in all the jargon and can't seem to find what I am looking
for.


You might get much better results on the boost-users mailing list. It's
worth subbing to, at least until you get over the learning curve, and you
can lurk at news:news.gmane.org .

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
May 13 '06 #2
Daz

Phlip wrote:
Daz wrote:
If anyone could help, or point out where I can find this information,
it would be very much appreciated. I have tried looking on boost.org,
but get lost in all the jargon and can't seem to find what I am looking
for.


You might get much better results on the boost-users mailing list. It's
worth subbing to, at least until you get over the learning curve, and you
can lurk at news:news.gmane.org .

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


I will do just that. Thanks for the advice :)

May 13 '06 #3
Daz

Daz wrote:
I will do just that. Thanks for the advice :)


Ok, I think I really am more stupid than I had originally suspected. I
am quite new to news groups, and I seriously don't understand how to
subscribe to the group, if I need software to view it, and how to
compile it on windows if it is needed. The only thing I can see for me
to do, is fill in a form, which looks as though it will create a new
group, which I don't think I want to do, or do I?

It doesn't look like anything I have ever seen before, and I have read
the FAQs which are very helpful, if I were to start a new group... :(

Sorry for being stupid, but thanks for your help. I will see if I can
figure it out.

Daz

May 13 '06 #4
Daz wrote:
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, converts a string into a 'path'
object, then checks to see if it exists. If it doesn't exist, the path
object needs to be reused and the new path string put into it (not
appended to it).


path_object = boost::filesystem::path(new_path_string);

May 13 '06 #5
Daz wrote:
Ok, I think I really am more stupid than I had originally suspected. I
am quite new to news groups


It's a mailing list. It's great for the full-timers, and sucks for
part-timers (quite the reverse of USENET). Fill out the form on their web
site, put your addy in, and you are there.

(And our newsgroup here is probably useful for _light_ Boost stuff...)

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
May 13 '06 #6
Daz

Phlip wrote:
Daz wrote:
Ok, I think I really am more stupid than I had originally suspected. I
am quite new to news groups


It's a mailing list. It's great for the full-timers, and sucks for
part-timers (quite the reverse of USENET). Fill out the form on their web
site, put your addy in, and you are there.

(And our newsgroup here is probably useful for _light_ Boost stuff...)

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


Excellent! I was just worried that I might have been needlessly
creating a new group that I had no intention of maintaining.

Thanks again Phlip. Both for your time, and your patience :)

It's very much appreciated.

Daz

May 13 '06 #7
Daz

Markus Schoder wrote:
Daz wrote:
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, converts a string into a 'path'
object, then checks to see if it exists. If it doesn't exist, the path
object needs to be reused and the new path string put into it (not
appended to it).


path_object = boost::filesystem::path(new_path_string);


Aaah, yes! I seem to remember reading about this in a tutorial
somewhere on c++ classes. I don't know why I didn't think of it, I
tried virtually everything else!

Thanks for the help Markus, much appreciated!

May 13 '06 #8
Daz wrote:
Markus Schoder wrote:
Daz wrote:
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, converts a string into a 'path'
object, then checks to see if it exists. If it doesn't exist, the path
object needs to be reused and the new path string put into it (not
appended to it).


path_object = boost::filesystem::path(new_path_string);


Aaah, yes! I seem to remember reading about this in a tutorial
somewhere on c++ classes. I don't know why I didn't think of it, I
tried virtually everything else!


(namespace fs = boost::filesystem;)

Note however that fs::path() does not understand native path formats by
default, you must give it fs::native:

fs::path p("c:\\file", fs::native);

If you don't, it'll throw.
Jonathan

May 13 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matthias | last post by:
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...
3
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...
3
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...
12
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...
3
by: Andreas S. | last post by:
Hi, I don't any solution any more... I have written a small tool wich uses the boost library. It compiles fine, but I can't link it. I am on a Fedora Core 6 x86_64 system. The boost library is...
2
by: soren.andersen | last post by:
Hello out there :-) I'm new to c++, coming from Java, and trying to learn the basics of the language and all that, basically just for fun. :-) So, when once I played around with c++ a bit i...
2
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...
5
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.