即使目录存在,nant directory :: exists也会返回false(nant directory::exists returns false even though directory exists)
我正在尝试检查目录是否作为NAnt脚本的一部分存在并获得误报。 这是脚本片段:
<echo message="${backup.dir} --> ${directory::exists('${backup.dir}')}"/>这是输出:
[echo] D:\D\RTC\backup\20110223 --> False除了该目录存在。
作为一个侧面说明,如果我跑..
<echo message="${backup.dir} --> ${directory::get-creation-time('${backup.dir}')}"/>我收到以下错误:
Expression: ${backup.dir} --> ${directory::get-creation-time('${backup.dir}')} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find a part of the path "D:\D\RTC\${backup.dir}".如果我运行..
<echo message="Directory Name --> ${path::get-directory-name('${backup.dir}')}"/>我明白了
[echo] Directory Name -->总而言之,我现在很困惑..有什么想法吗?
I'm trying to check for if a directory exists as part of a NAnt script and getting a false negative. Here is the script fragment:
<echo message="${backup.dir} --> ${directory::exists('${backup.dir}')}"/>Here is the output:
[echo] D:\D\RTC\backup\20110223 --> FalseExcept the directory exists.
As a side note if I run..
<echo message="${backup.dir} --> ${directory::get-creation-time('${backup.dir}')}"/>I get the following error:
Expression: ${backup.dir} --> ${directory::get-creation-time('${backup.dir}')} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find a part of the path "D:\D\RTC\${backup.dir}".AND if I run..
<echo message="Directory Name --> ${path::get-directory-name('${backup.dir}')}"/>I get
[echo] Directory Name -->All in all I'm very confused right now.. Any thoughts?
最满意答案
您不能以嵌套方式使用${} :
<echo message="${backup.dir} --> ${directory::exists(backup.dir)}"/>You must not use ${} in a nested way:
<echo message="${backup.dir} --> ${directory::exists(backup.dir)}"/>更多推荐
backup,dir,-->,电脑培训,计算机培训,IT培训"/> <meta name="description
发布评论