deleting a boost::filesystem::path object

D

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
 
P

Phlip

Daz said:
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 .
 
D

Daz

Phlip said:
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 .

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

Daz

Daz said:
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
 
M

Markus Schoder

Daz said:
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);
 
P

Phlip

Daz said:
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...)
 
D

Daz

Phlip said:
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...)

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
 
D

Daz

Markus said:
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!
 
J

Jonathan Mcdougall

Daz said:
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
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top