c++ - 从 C++ 程序调用 git clone
问题描述
我正在尝试从 Windows 中的 C++ 程序调用“git clone”,为此我创建了一个空文件夹(使用 std::filesystem::create_directory 和 _chdir),然后我以这种方式使用 CreateProcessW:
::CreateProcessW(std::wstring(fullPath.begin(), fullPath.end()).c_str(),
const_cast<LPWSTR>(std::wstring(fullArgs.begin(), fullArgs.end()).c_str()),
nullptr,
nullptr,
TRUE,
_createNewConsole ? CREATE_NEW_CONSOLE : 0,
nullptr,
std::wstring(_path.begin(), _path.end()).c_str(),
&siStartInfo,
&piProcInfo);
但是当我这样做时,Git 会返回以下错误消息:
fatal: could not create work tree dir 'XXXX': Permission denied
但是,由于我自己创建了文件夹,所以我不确定是什么问题
文件夹权限如下:
drwxr-xr-x
知道如何解决吗?
解决方案
尝试
chmod -R 777 你的文件夹
推荐阅读
- c# - How can I create files in Azure Data Lake File Shares from .NET?
- c++ - GPA Calculator not Returning Corresponding Grades
- reactjs - React Redux 在映射状态后获取 NaN
- javascript - How to call javascript function in external file in Angular
- javascript - 事件侦听器按什么顺序添加到调用堆栈中?
- amazon-web-services - AWS DynamoDB 扫描返回项目数组 - 如何按主键请求键值字典?
- crosstab - Cognos Crosstab Rows - 来自数据的标签值
- reactjs - React 设计问题:具有相同 UI 布局但数据不同的多个页面
- c# - 调试 .net core Application System.StackOverflowException c#
- php - 网站下载 php 文件而不是加载页面 NGINX