Re: Path Unreachable Check
You may want to try creating a temp file in that path and then use the file exists method to double check it.
Re: Path Unreachable Check
VB Code:
if System.IO.Directory.Exists("\\computer1\targetdirectory\") then
'copy file
else
'dir doesnt exist
end if
Re: Path Unreachable Check
Nice, kleinma. Show me up as usual :( :lol:
Your way is good but my way will make sure the files can be copied over to
in case of any permission issues. :D
Re: Path Unreachable Check
Quote:
Originally Posted by RobDog888
Nice, kleinma. Show me up as usual :( :lol:
Your way is good but my way will make sure the files can be copied over to
in case of any permission issues. :D
true... but technically if I was coding this, I would check for the path to exist. if it does, then I would do the file copy in try/catch blocks, which would handle any issue like permissions... ;)
Re: Path Unreachable Check
I think I'm having one of "those" days :(
Yet again, you have the best solution. :thumb:
Re: Path Unreachable Check
Quote:
Originally Posted by RobDog888
I think I'm having one of "those" days :(
Yet again, you have the best solution. :thumb:
its ok rob.. you just have a case of the user control blues :(
Re: Path Unreachable Check
:D Actually I am feeling good today because I got my car back with new tires on the rear. Now I can
go back to racing all those punks that think they are faster then me with their little
import toy racer cars :lol:
But I do have a new thread on my UC. Its a small question.
Re: Path Unreachable Check [RESOLVED]
Quote:
Originally Posted by kleinma
true... but technically if I was coding this, I would check for the path to exist. if it does, then I would do the file copy in try/catch blocks, which would handle any issue like permissions... ;)
Here's what I have working with the exception of permissions problems.
Permissions problems are what I'm dealing with now. I'll put in the try/catch. Thanks...
VB Code:
If Directory.Exists(target) Then
If File.Exists(copytarget) Then
File.Delete(copytarget)
End If
'don't copy *.scc files
Dim extcheck() As String = Split(xFiles(y), ".")
If Directory.Exists(target) Then
If UCase(extcheck(UBound(extcheck))) <> "SCC" Then
writelog.WriteLine(ControlChars.Tab & copytarget)
File.Copy(copysource, copytarget)
End If
Else
writelog.WriteLine("*************************************")
writelog.WriteLine("** Could not reach " & copytarget)
writelog.WriteLine("*************************************")
End If
Else
Dim detailmsg As String = "*************************************" & _
vbCrLf & "** Could not reach " & target & _
vbCrLf & "*************************************"
writelog.WriteLine(detailmsg)
End If