]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/filesystem/test/long_path_test.cpp
1 // long_path_test.cpp ----------------------------------------------------------------//
3 // Copyright Beman Dawes 2011
5 // Distributed under the Boost Software License, Version 1.0.
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://www.boost.org/libs/btree for documentation.
10 // See http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
12 #include <boost/config/warning_disable.hpp>
14 #include <boost/filesystem.hpp>
18 using namespace boost::filesystem
;
20 #include <boost/detail/lightweight_test.hpp>
21 #include <boost/detail/lightweight_main.hpp>
25 } // unnamed namespace
27 int cpp_main(int, char*[])
30 std::string
prefix("d:\\temp\\");
31 std::cout
<< "prefix is " << prefix
<< '\n';
33 const std::size_t safe_size
34 = 260 - prefix
.size() - 100; // Windows MAX_PATH is 260
36 std::string
safe_x_string(safe_size
, 'x');
37 std::string
safe_y_string(safe_size
, 'y');
38 std::string
path_escape("\\\\?\\");
40 path
x_p(prefix
+ safe_x_string
);
41 path
y_p(path_escape
+ prefix
+ safe_x_string
+ "\\" + safe_y_string
);
43 std::cout
<< "x_p.native().size() is " << x_p
.native().size() << '\n';
44 std::cout
<< "y_p.native().size() is " << y_p
.native().size() << '\n';
46 create_directory(x_p
);
47 BOOST_TEST(exists(x_p
));
48 create_directory(y_p
);
49 BOOST_TEST(exists(y_p
));
51 //std::cout << "directory x.../y... ready for testing, where ... is " << safe_size
52 // << " repeats of x and y, respectively\n";
54 BOOST_TEST(exists(x_p
));
58 return ::boost::report_errors();