False report of existence of file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BobRoyAce

    False report of existence of file

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

    If (_InfeedFilefol der.Length 0) AndAlso (_InfeedFilenam e.Length >
    0) Then
    If (My.Computer.Fi leSystem.FileEx ists(GetFullInf eedFilePath) =
    False) Then
    _BrokenRules.Ap pendLine(" - Infeed file does not exist (" &
    GetFullInfeedFi lePath() & ")")
    End If
    End If

    GetFullInfeedFi lePath 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.Fil eSystem.FileExi sts(GetFullInfe edFilePath) 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.
  • kimiraikkonen

    #2
    Re: False report of existence of file

    On Mar 25, 11:14 pm, BobRoyAce <b...@omegasoft wareinc.comwrot e:
    I use the following code to check to see if a file exists in a folder:
    >
      If (_InfeedFilefol der.Length 0) AndAlso (_InfeedFilenam e.Length >
    0) Then
        If (My.Computer.Fi leSystem.FileEx ists(GetFullInf eedFilePath) =
    False) Then
          _BrokenRules.Ap pendLine("  - Infeed file does not exist (" &
    GetFullInfeedFi lePath() & ")")
        End If
      End If
    >
    GetFullInfeedFi lePath 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.Fil eSystem.FileExi sts(GetFullInfe edFilePath) 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

    Comment

    • BobRoyAce

      #3
      Re: False report of existence of file

      Would you also mind trying "system.io.file .exists" nethod if situation
      changes?
      Will try that and post results...won't happen for a day or two though.
      I was wondering about the My.Computer.Fil eSystem part, so, we'll
      see...

      Comment

      Working...