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
0 answers
Own program prints different directory sizes than DU
I made a little c++ project to print the sizes of directories and files ordened. However, I noticed that I get a difference in size for what du reports and what my program, using boost::filesystem, reports. Could anyone tell me what kind of error I…

jelmew
- 543
- 1
- 7
- 15
0
votes
1 answer
Linker error when compiling with Boost.Filesystem on macOS High Sierra
I'm currently trying to compile a program that uses Boost.Filesystem on macOS High Sierra 10.13.4. I'm also using gcc 7.3 to compile, which I manually installed using Homebrew. The program will compile, but then throws the following error during…

Nick Hirzel
- 153
- 5
0
votes
1 answer
Error while building boost for android arm architectures
Why am I getting these errors only when building some particular boost libraries like filesystem for arm ?
error: no member named 'fgetpos' in the global namespace
error: no member named 'fsetpos' in the global namespace
error: no member named…

Rahul Naik
- 105
- 1
- 9
0
votes
0 answers
Storing an auto specified variable into a string variable?
I'm sorry if my terminology might be wrong but I have an example code here using the "filesystem" library where it displays all the directory contents and its sub-contents using a for loop and it uses an auto type variable 'p'. I want to convert…

slowjoe44
- 7
- 3
0
votes
1 answer
boost/filesystem.hpp not linking in osx boost installed via homebrew
I installed boost via
$ brew install boost
In xcode I have specified
/usr/local/Cellar/boost/1.65.1/include
in my header search path and
/usr/local/Cellar/boost/1.65.1/lib
in my library search path. I can successfully
#include…

interwebjill
- 920
- 13
- 38
0
votes
1 answer
Remove dependency on boost::filesystem::current_path()
I have a single line of code for which I include the boost-filesystem 1.64 library which I'd love to remove, so I can remove the dependency on Boost altogether from my program.
The line itself:
std::string currentPath =…

blipman17
- 523
- 3
- 23
0
votes
0 answers
How to insert values from boost::filesystem::directory_iterator() to a map
std::copy(boost::filesystem::directory_iterator(paths),
boost::filesystem::directory_iterator(), // directory_iterator::value_type
std::ostream_iterator(std::cout, "\n"));"
The above code will return files in a…

DILU SEBASTIAN
- 11
- 3
0
votes
1 answer
Basic concepts with std::string references, std::regex and boost::filesystem
Below, I produce both broken code and a fixed version of the same. The problem is that I am not able to fully explain to myself why the former doesn't work but the latter does. I obviously need to review some very basic concept of the C++ language:…

augustin
- 14,373
- 13
- 66
- 79
0
votes
1 answer
C++ ReadDirectoryChangesW and Boost returns dir change as File (OLD NAME)
I have an application which is monitoring directories for changes. However, when I rename a directory, lets say Directory A into Directory B, than I will see the following output results:
File renamed (OLD): C:\A
Directory renamed (NEW): C:\B
while…

TVA van Hesteren
- 1,031
- 3
- 20
- 47
0
votes
1 answer
How do you "update" a diretory_iterator after changes to a directory have been made?
I am writing a program using C++ and Boost::filesystem. The program is supposed to take pictures in a given directory and move them to folders. Each folder is supposed to only hold a given number of pictures.…

Wheathin
- 98
- 8
0
votes
1 answer
c++ - BOOST filesystem path from variable string
I ran into this issue when creating a boost::filesystem::path object (boost v1.55). I couldn't figure out how to create a path from from a String variable, or concatenation of Strings?
//Example 1
namespace fs = boost::filesystem;
String dest =…

RisaAudr
- 53
- 1
- 5
- 10
0
votes
1 answer
C++ - Update/mirror a folder backup with BOOST Filesystem (1.55)
I am attempting to backing up a user profile (or more accurately copying specific directories e.g. username\documents, username\desktop, etc.) to a network shared drive. I'm using C++ builder (10.1 starter), thus limited to boost 1.55.
I've found…

RisaAudr
- 53
- 1
- 5
- 10
0
votes
1 answer
boost::filesystem::path.parent_path() and whitespace
I want to check a path from a users input. The input must provide a path of a file which does not exist. Further, if the input also provides directories, these directories must exists.
Example inputs:
/existent_dir_a/existent_dir_b/existent_file.bin…

user1587451
- 978
- 3
- 15
- 30
0
votes
1 answer
Non deterministic execution of boost filesystem directory_iterator
The following code recursively iterates over a given directory and prints its contents in the same order every time.
Is it possible to alter the directory iterator to print the directory contents in a random way (without i.e. using a vector to store…

charis
- 429
- 6
- 16
0
votes
1 answer
What is the expected form of boost::filesystem::native path?
I did a Google search to see how to check if a given path is valid, preferably using boost.
It brought me here:
How to check if path is valid in boost::filesystem?
Great! I say to myself.
I then Google up the boost doc…

Christopher Pisz
- 3,757
- 4
- 29
- 65