开发者

Nant - Check if a remote share already exists

We are using Nant to deploy an application and need to ensure that a share is created during the process.

We use psexec and net share to create the share but this fails and stops Nant if the share already exists.

Is the开发者_开发问答re any way to detect that a share exists already?

Either before trying to create the share or being able to detect the return code of 2 or the The name has already been shared message from psexec?

I have tried directory::exists but this always returns false.

I have tried copying a file to the remote dir and file::exists but this always returns false.


It appears I am doing something wrong with my variables and paths:

<echo message="exists!" if="${directory::exists('\\${server}\share')}"/>

does not work, however:

<property name="test" value="\\${server}\share" />
<echo message="exists!" if="${directory::exists(test)}"/>

works fine!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜