False report of existence of file

  • Thread starter Thread starter BobRoyAce
  • Start date Start date
B

BobRoyAce

I use the following code to check to see if a file exists in a folder:

If (_InfeedFilefolder.Length > 0) AndAlso (_InfeedFilename.Length >
0) Then
If (My.Computer.FileSystem.FileExists(GetFullInfeedFilePath) =
False) Then
_BrokenRules.AppendLine(" - Infeed file does not exist (" &
GetFullInfeedFilePath() & ")")
End If
End If

GetFullInfeedFilePath is a function that returns the full path to the
file.

Well, when I run this code on my development machine, it works like a
charm. However, when I run it on a server box at my client's site,
My.Computer.FileSystem.FileExists(GetFullInfeedFilePath) returns False
for files that do, in fact, exist. When I copy and paste the full path
it's checking for the existence of into Windows Explorer, the file
comes up no problem.

Any ideas as to why this would be happening?

In case this is relevant, I am developing on a Vista machine with
VS2008, the the server is a Windows 2003 Server box.
 
I use the following code to check to see if a file exists in a folder:

  If (_InfeedFilefolder.Length > 0) AndAlso (_InfeedFilename.Length >
0) Then
    If (My.Computer.FileSystem.FileExists(GetFullInfeedFilePath) =
False) Then
      _BrokenRules.AppendLine("  - Infeed file does not exist (" &
GetFullInfeedFilePath() & ")")
    End If
  End If

GetFullInfeedFilePath is a function that returns the full path to the
file.

Well, when I run this code on my development machine, it works like a
charm. However, when I run it on a server box at my client's site,
My.Computer.FileSystem.FileExists(GetFullInfeedFilePath) returns False
for files that do, in fact, exist. When I copy and paste the full path
it's checking for the existence of into Windows Explorer, the file
comes up no problem.

Any ideas as to why this would be happening?

In case this is relevant, I am developing on a Vista machine with
VS2008, the the server is a Windows 2003 Server box.

Bob,
Would you also mind trying "system.io.file.exists" nethod if situation
changes?

Regards,

Onur Güzel
 
Would you also mind trying "system.io.file.exists" nethod if situation

Will try that and post results...won't happen for a day or two though.
I was wondering about the My.Computer.FileSystem part, so, we'll
see...
 
Back
Top