使用 \\?\ 提升文件系统在 windows 下制作长路径

boost filesystem making long path under windows using \\?\

它是如此简单,但我无法让它工作,我不知道为什么??
我只想制作一个长路径的目录。
我将 \\?\ 添加到 E:\... 以使其成为 win api 所说的 .
但徒劳无功.....只有错误。
我尝试了 \?\\?\ 但没有成功。
这是代码:

// boost_create_directory.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <fstream>
#include <string>
#include <time.h>
#include <stdio.h>
#include <ctime>
#include <iostream>
#include <map> //Needed to use the std::map class.
//#include "symbols_array2.h"
//#include "functions.h"
#include <boost/filesystem.hpp>
//#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>

////#include <filesystem>
////namespace fs = std::filesystem;
//#define DOWNLOAD_ALL true


int main()
{
using namespace std;
using namespace boost::filesystem;


//string localpath, binlocalfile, localfile;
string localpath = "\\?\E:\instruments\symbol\year\month\day\";

//boost::filesystem::path abs_localpath;
////string localpath = "E:\instruments\symbol\year\month\day\";
boost::filesystem::path abs_localpath(localpath) ;


////string localpath = "\\?\E:\instruments\symbol\year\month\day\";
////boost::filesystem::path abs_localpath("\\?\E:\instruments\symbol\year\month\day\");
////string localpath = "E:/i/";

////boost::filesystem::path abs_localpath("\?\E:\instruments\symbol\year\month\day\");
////boost::filesystem::path path_argument(localpath);
////boost::filesystem::path path_native(path_argument.make_preferred());
////boost::filesystem::path abs_localpath(absolute(path_native));

//binlocalfile = localpath + "\hourh_ticks.bin";
//localfile = localpath + "\hourh_ticks.bi5";

//abs_localpath = boost::filesystem::absolute(localpath.c_str());
//abs_localpath = localpath;

//if (!boost::filesystem::exists(abs_localpath))
//{
    //boost::filesystem::path abs_localpath;
    //cout << current_path().string() << endl;
    //cout << abs_localpath << endl;
    //boost::filesystem::create_directory(abs_localpath);
for (int z = 0; z < 10; z++)
{

    if (boost::filesystem::create_directory(abs_localpath)) {
        std::cout << "Success making new directory" << "\n";
        //boost::filesystem::permissions(abs_localpath, perms_mask);
    }
    //localpath = localpath + "\instruments\symbol\year\month\day";
    abs_localpath / "instruments\symbol\year\month\day\";
    ////abs_localpath /= "\instruments\symbol\year\month\day\";

}
    //mkdir($localpath, 0777, true);
//}
boost::filesystem::path path("\?\E:\MyStuff\");

boost::filesystem::create_directory(path);
return 0;

}

希望能提前找到答案here.thanks。

这是我的错。如果路径已经创建,create_directory函数会生成单个目录,如果路径丢失,return会出错,所以我需要create_directories复数版本路径和瞧的所有缺失元素。
我希望他们将这些名称更改为 create_single_directory 或 create_target_directory 并将复数更改为 create_path_directories