UNIX mkdir具有-p标志,用于在父目录不存在时创建父目录。在cleartool中有没有对应的工具呢?显然,如果foo还不存在,cleartool mkdir foo/bar/就不能工作。
发布于 2019-04-11 23:22:38
最简单的方法是在目录结构中创建一个文件,并使用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的区域设置是宽字符,并且"temp.txt“是使用"dir > temp1\temp2\temp.txt”创建的。
发布于 2019-04-12 05:04:49
当添加一个文件时,cleartool mkelem -mkpath是一个很好的选择。
但是如果你有多个文件要添加,在一个还不存在的树形结构中,不要忘记clearfsimport:它可以在一个命令中import flat files to a branch,并将为你创建任何缺失的文件夹。
作为seen here:clearfsimport -rec -nset <Source> <target>
https://stackoverflow.com/questions/55633145
复制相似问题