I would like to use the boost::filesystem library, starting out with checking that the file_size() function works.
Following this tutorial I start out by running tut1.cpp, and that runs.
But when I try to use file_size() in my own program I run into problems. If I use file_size("testfile.cpp") I get "boost::filesystem::file_size: No such file or directory", and if I use file_size("./testfile.cpp") I get "boost::filesystem::file_size: Operation not permitted."
I am sure that the path is correct because system("cat testfile.cpp") works fine.
I would like to use the
boost::filesystem
library, starting out with checking that thefile_size()
function works.Following this tutorial I start out by running
tut1.cpp
, and that runs.But when I try to use
file_size()
in my own program I run into problems. If I usefile_size("testfile.cpp")
I get "boost::filesystem::file_size: No such file or directory", and if I usefile_size("./testfile.cpp")
I get "boost::filesystem::file_size: Operation not permitted."I am sure that the path is correct because
system("cat testfile.cpp")
works fine.I compile the program with:
-I /usr/local/opt/boost/include -L /usr/local/opt/boost/lib -lboost_system -lboost_filesystem