我正在开发一个项目,我需要从UI创建一个新目录。但是,我收到错误" mkdir操作不受支持"。以下是mkdir函数的代码:
$scope.mkdir = function () {
var modal = $modal({
title: 'Create Directory',
contentTemplate: 'new-folder.html',
//controller : 'Transfer',
scope: $scope
});
modal.$scope.uri.parsed = $scope.uri.parsed;
/*modalInstance.result.then(function (pn) {
var u = new URI(pn[0]).segment(pn[1]);
return stork.mkdir(u.href()).then(
function (m) {
$scope.refresh();
}, function (e) {
alert('Could not create folder: '+e.error);
}
);
});*/
};
$scope.mk_dir = function (name) {
var u = $scope.uri.parsed;
u = u._string+name+"/";
//u = new URI(u);
if (!u) return;
//u.segment(name);
return stork.mkdir(u).then(
function (m) {
$scope.refresh();
}, function (e) {
alert('Could not create folder: '+e.error);
}
);
};
它需要保留一个新目录。有什么建议吗?
提前致谢!