即使目录存在,nant directory::exists 也会返回 false
我正在尝试检查目录是否作为 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 --> False
Except 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不得以嵌套方式使用
${}
:You must not use
${}
in a nested way: