*I want to test the script have access to a particular file share using nant. so i started checking this by doing a simple file copy on to that share. this worked fine, but when the share do not have write permissions , script is crashing even though i have try catch because of System.UnauthorizedAccessException: Access to the path '\mypc\testsharefolder\systemaccesscheck.txt' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)*
kindly suggest me a way to get around this problem, or a script to check the access rights.
`<target name="test.target">
<echo>start of try catch block</echo>
<trycatch>
<try>
<copy file="c:\systemaccesscheck.txt" todir="\\mypc\testsharefolder" overwrite="true"/>
<echo>filecopy passed</echo>
</try>
<catch property="failure">
<echo>inside catch block because of failure</echo>
</catch>
</trycatch>
<echo>End of try catch block</echo>`