문제

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 there 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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top