首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >相当于清除工具mkdir的mkdir -p

相当于清除工具mkdir的mkdir -p
EN

Stack Overflow用户
提问于 2019-04-11 21:02:01
回答 2查看 173关注 0票数 1

UNIX mkdir具有-p标志,用于在父目录不存在时创建父目录。在cleartool中有没有对应的工具呢?显然,如果foo还不存在,cleartool mkdir foo/bar/就不能工作。

EN

回答 2

Stack Overflow用户

发布于 2019-04-11 23:22:38

最简单的方法是在目录结构中创建一个文件,并使用mkelem -mkpath...

我在我的一个沙箱vobs中创建了一个"temp1“目录、一个"temp2”目录和一个"temp.txt“文件,然后使用-mkpath将该文件从"temp1”视图私有目录的父目录添加到源代码管理中。

代码语言:javascript
复制
PS M:\tempview\foobarf\Documents> cleartool mkelem -mkpath .\temp1\temp2\temp.txt
Creating parent directory element ".\temp1\temp2".
Creating parent directory element ".\temp1".
Created directory element ".\temp1".
Checking out parent directory ".\temp1".
Created directory element ".\temp1\temp2".
Checking out parent directory ".\temp1\temp2".
Creation comments for ".\temp1\temp2\temp.txt":
Test1.
.
Created element ".\temp1\temp2\temp.txt" (type "utf16le_file").
Checked out ".\temp1\temp2\temp.txt" from version "\main\0".

它是UTF-16LE,因为Powershell的区域设置是宽字符,并且"temp.txt“是使用"dir > temp1\temp2\temp.txt”创建的。

票数 1
EN

Stack Overflow用户

发布于 2019-04-12 05:04:49

当添加一个文件时,cleartool mkelem -mkpath是一个很好的选择。

但是如果你有多个文件要添加,在一个还不存在的树形结构中,不要忘记clearfsimport:它可以在一个命令中import flat files to a branch,并将为你创建任何缺失的文件夹。

作为seen hereclearfsimport -rec -nset <Source> <target>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55633145

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档