The Boost.Filesystem library provides facilities to manipulate files and directories, and the paths that identify them.
Questions tagged [boost-filesystem]
353 questions
0
votes
1 answer
Finding whether file is being copied or not in C++(in Windows)?
I want to figure out whether a given file is being copied or not. Initially I thought of doing fopen(_file) as fopen returns false while file is getting copied. But this idea fails when the file is opened in some applications(eg: when ppt is opened…

Gokulakrishnan Gopalakrishnan
- 105
- 2
- 13
0
votes
0 answers
boost error: expected primary-expression before ‘>’ token
The following code print process current work path. Use boost 1.52, works in visual studio 2010.
#include
#include
#include "boost/algorithm/string.hpp"
#include "boost/filesystem/path.hpp"
#include…

powerpanda
- 1
- 2
0
votes
0 answers
How to check in a portable way that a file path is potentially valid?
I need to determine that a string entered by a user is OK to create a file with that name. My application is built on Qt and runs on Windows and Mac OS.
I've found a check function in boost.filesystem, namely native(). The documentation says,…

Alexander Dunaev
- 980
- 1
- 15
- 40
0
votes
2 answers
How to store user defined field in metadata of any files?
i am developing a synchronization app, i need to store unique id in the metadata of each files when they are put in to my app, thus i can match the similar files between server and client,(matching the similar files using name is not good ,name can…
user1787584
0
votes
1 answer
Boost filesystem not found
I get the following error during my PION installation in Oracle Linux 5.5:
Unable to link with the boost filesystem library
The curious is that others libraries can be found and there are in the same directory
Can anyone help me on this..
Thanks

Belkis Morgalo
- 3
- 4
0
votes
1 answer
testing a boost example
This is my first test using Boost (1.5.3). I made an example with FileSystem class.
I think I've installed successfully the binary distribution, i.e., run bootstrap.bat and b2.exe to create headers & libraries in the installed folder.
if I'm…

TSL_
- 2,049
- 3
- 34
- 55
0
votes
1 answer
boost copy_file has inconsistent behavior when overwrite_if_exists is used
I am having trouble with boost copy_file(version 1.40.0) method, I would like to overwrite the destination file completely, but it ends up merging source file and destination file if destination text file has more lines.
copy_file(source,…

erin c
- 1,345
- 2
- 20
- 36
0
votes
1 answer
Recursively scanning the directory for the files
I am trying to iterate over the directory and print the name of all the files starting from the root.
Here's the short snippet I have written using Boost::Filesystem (1.52.0) in my program.
void testApp::getNames(const string& dirPath, string&…

user1240679
- 6,829
- 17
- 60
- 89
0
votes
1 answer
Determining the exact reason for not opening of file
The problem is that std::fstream doesn't throw exceptions by default but rather sets bits that can then be examined. Apparently, it can then be made to throw exceptions (I think) by using the exceptions function as explained here -- see e.g. c++…

Ben J
- 1,367
- 2
- 15
- 33
0
votes
1 answer
method for getting correct system path on windows
I have made up a simple http server using libevent. The way the resource (folders in my case) are accessed is
http://serverAddress:port/path/to/resouce/
the path to resource is extracted using the decoded url . It works fine on Linux as request…

Vihaan Verma
- 12,815
- 19
- 97
- 126
0
votes
1 answer
Boost Filesystem Library Visual C++ Compile Error
I'm having the following issue just trying to compile/run some of the example programs with the Boost Filesystem Library. I'm using MS-Visual C++ with Visual Studio .NET (2003).
I've installed the Boost libraries, version 1.38 and 1.39 (just in…
0
votes
2 answers
MongoDB C++ Driver installation on Mac OS
It's been 2 days I'm trying to install the driver C++ of MongoDB but I keep running into the same mistake ( in Mac OS X environnement )
In file included from /opt/local/include/boost/filesystem/operations.hpp:24,
from…

flocks
- 218
- 2
- 13
0
votes
1 answer
directory_iterator file_iter to rename files in a folder
I wanted to rename the files in a directory.There are 52 folders in the directory. Each folder has a different name and has around 40 files in each of them.I wanted to extract the name of a particular folder and attach that name to the name of the…

cameo
- 77
- 1
- 1
- 10
0
votes
1 answer
writing parameters to a file from a (declaration) header
I wish to write the list of all parameter values used for the current run to a parameterFile.txt in the output directory.
I have all the parameters declared in one of the header files say constants.hpp. I was trying the boost::filesystem copy_file…

Nikhil J Joshi
- 1,177
- 2
- 12
- 25
0
votes
1 answer
Boost FileSystems, need help understanding what I'm doing
I wrote a program using boost filesystems almost a year ago, and I am now trying to go back and use that for a reference, but I'm not sure exactly what is going on with the code, and if there might be a better way to do it.
Here is what I had done…

MVTC
- 845
- 11
- 28