using boost::filesystem::delete
Hi: I have a boost::filesystem::wpath object. I need to firstly check if the file exists, and secondly delete and check the file has been deleted. How would I go about this? I've loked at the reference and carn't seem to make sense, are thee any examples of both these functions? Any help apreciated. Sean.
Hi: I have a boost::filesystem::wpath object. I need to firstly check if the file exists, and secondly delete and check the file has been deleted. How would I go about this? I've loked at the reference and carn't seem to make sense, are thee any examples of both these functions?
Any help apreciated. Sean.
checking if a file exists... http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#Pred... second method. removing a file... http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#Oper... sixth method. Patuti
On Tue, Mar 3, 2009 at 12:43, Everton Patitucci
I have a boost::filesystem::wpath object. I need to firstly check if the file exists, and secondly delete and check the file has been deleted. How would I go about this? I've loked at the reference and carn't seem to make sense, are thee any examples of both these functions?
Sean.
removing a file... http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#Oper... sixth method.
Remove doesn't consider file not found to be an error, so why check? Checking -- either before or after -- introduces race conditions. If remove doesn't throw, then the file was gone at that point. Confirming that seems like a waste of effort.
2009/3/3 Sean Farrow
I have a boost::filesystem::wpath object. I need to firstly check if the file exists, and secondly delete and check the file has been deleted. How would I go about this? I've loked at the reference and carn't seem to make sense, are thee any examples of both these functions?
Check the reference again:
http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#Oper...
#include
participants (4)
-
Christoph Gysin
-
Everton Patitucci
-
Scott McMurray
-
Sean Farrow