相当于用于cleartool mkdir的mkdir -p

问题描述 投票:1回答:2

UNIX mkdir具有-p标志,如果它们不存在,则创建父目录。那个cleartool有相同的东西吗?当cleartool mkdir foo/bar/尚不存在时,显然foo不起作用。

clearcase cleartool
2个回答
0
投票

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

我在我的一个沙盒vobs中创建了一个“temp1”目录,一个“temp2”目录和一个“temp.txt”文件,然后使用-mkpath将文件添加到源控件中,从“temp1”视图私有目录。

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的Locale是宽字符,而“temp.txt”是使用“dir> temp1 \ temp2 \ temp.txt”创建的。


0
投票

添加一个文件时,cleartool mkelem -mkpath是一个不错的选择。

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

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

© www.soinside.com 2019 - 2024. All rights reserved.