Questions tagged [boost-filesystem]

The Boost.Filesystem library provides facilities to manipulate files and directories, and the paths that identify them.

353 questions
0
votes
1 answer

boost::file_system::create_directory doesn't create directory, yet ErroCode is SUCCESS

So, I am using a simple code like boost::system::error_code ec; if (!boost::filesystem::create_directory(out_path.parent_path(), ec)) { std::cerr << "couldn't create directory\n"; std::cerr << ec.message() << "\n"; return -1; } I am…
Andy Silver
  • 155
  • 3
  • 8
0
votes
2 answers

Why does boost::filesystem::path return a path instead of string

I have this peace of code string targetFile = string + boost::filesystem::path.filename() the problem is that it considers path.filename() as path instead of the string that the documentation tells…
AnotherOne
  • 854
  • 2
  • 8
  • 19
0
votes
0 answers

Compiling and running C++11 with a local GCC installation

I'm trying to compile and run a C++11 program which uses Boost.Filesystem -- let's say to list the contents of a directory -- in a shared web hosting environment. Since the software installed on this system is generally 4 years old, and I need to…
mooiamaduck
  • 2,066
  • 12
  • 13
0
votes
1 answer

Adding filesystem-boost as a cmake library causes undefined symbol error

I was writing a cmake project file with multiple dependencies, and when it tried to link boost-filesystem, it threw and undefined symbol error. The curious thing is that if the cmake file for boost was run independently of the larger project cmake…
0
votes
1 answer

Why does vector always stay empty?

So, the program takes a path to folder as command line option, then reads all the files in folder and if the file contents is correct (it should be an integer), it outputs the filename and an integer (example: test.txt : 192), check() function…
fuz
  • 23
  • 1
  • 3
0
votes
1 answer

Using Google Cloud Storage as central store for multi-instance Google Compute Engine

I am using the Google Compute Engine to distribute simulation workload over multiple instances (machines) - all coded in C++ and using OpenMPI to parallelize calculations. Each 'remote' instance generates considerable data output that I now gather…
0
votes
0 answers

boost last_write_time first chance exception raised. Why?

I'm writing app that does some hot-reloading of files and from time to time, "First chance exception" is raised by debugger. I've tried several tests and I cannot figure out why this keep happening. time_t time =…
sphere42
  • 156
  • 1
  • 11
0
votes
1 answer

How to access the string representation of boost filesystem's path class, and remove the quotes

I want to save the path to the files in a dir as a string. The example from the tutorial pretty much does what I want except that it does it with the quotation marks which I want to be removed. Now I know that I can do it by adding .string() to the…
Namal
  • 281
  • 2
  • 10
0
votes
2 answers

c++ boost Get files from Disk in Parallel

I'm looking for a fast way to get a List of Files with certain attributes, in parallel from Disk. Attributes: file size, absolute file path Currently i'm using boost filesystem and a recursive call with directory iterators. It's fine for small…
eul3r
  • 1
  • 1
0
votes
1 answer

Iterate over pairs of two files in a directory

I have a directory full of files named foo-1.ocf foo-2.ocf bar-1.ocf bar-2.ocf file-1.ocf file-2.ocf I want to iterate over each pair of files, if bot files exist (-1.ocf and -2.ocf). What is a good approach to do this in boost?
tzippy
  • 6,458
  • 30
  • 82
  • 151
0
votes
1 answer

Including boost libraries in C++ Win x64 application

I have a C++ console application which I successfully compiled for windows x86 platforms using Microsoft SDK compiler. Now, I want to compile the same source code for x64 systems. I am using boost libraries (file systems, program options and some…
serhatg
  • 312
  • 1
  • 3
  • 15
0
votes
1 answer

Get modification time of locked folder with boost::filesystem::last_write_time

When I'm using time_t t = last_write_time("C:\\System Volume Information"); I get the following exception: boost::filesystem::last_write_time: Access denied: "C:\System Volume Information" Nevertheless, Windows Explorer is able to get access to…
polkovnikov.ph
  • 6,256
  • 6
  • 44
  • 79
0
votes
2 answers

Error using boost::filesystem

I'm trying to read all .txt files into a given folder, and I am trying to use Boost libraries for that: int FileLoad::ReadTxtFiles(const std::string folder){ int loadStatus = LOAD_OK; // Check if given folder exists …
Roman Rdgz
  • 12,836
  • 41
  • 131
  • 207
0
votes
3 answers

Valgrind reports Invalid read of size 8 on boost::filesystem::path::parent_path()

The following code works as expected but when run with valgrind it will report an "Invalid read of size 8" error. #include #include #include #include…
Sjoerd222888
  • 3,228
  • 3
  • 31
  • 64
0
votes
1 answer

Boost not finding file

I want to use Boost's filesystem functions. I try cout << boost::filesystem::file_size(fname.c_str()) << endl; where fname="file.txt"; and I get the error boost::filesystem::file_size: No such file or directory I am sure I have the right path…
jorgen
  • 3,425
  • 4
  • 31
  • 53