gpt4 book ai didi

windows - Perl chdir 不起作用

转载 作者:可可西里 更新时间:2023-11-01 09:30:38 31 4
gpt4 key购买 nike

以前的帖子可能会有用:Perl system() call failed with return code 65280

同样,我多次使用此代码,但在这里不起作用。我已将所有其他 perl 实例从 PATH 中移走。

来源:

$targetDir = "M\:\\bldforge_AOMS_DEV";
print ("targetDir=$targetDir\n");

chdir($targetDir) or die "Cant chdir to $dir $!";
$current_dir = `cd`;
print "\nCurrent dir = $current_dir\n"

输出:

Z:\>ccperl test.pl
targetDir=M:\bldforge_AOMS_DEV

Current dir =

最佳答案

为了确保您确实处于 ClearCase View 中,我会使用 cleartool pwd :

$current_dir = `cleartool pwd`;

这甚至可以在 Windows 上运行:

The cleartool pwd command lists the current working directory.
This command is intended for use in interactive cleartool and multitool sessions, and in batch files or shell scripts that simulate interactive sessions.

关于windows - Perl chdir 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12006798/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com