Avoiding a FileInUse access

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

    #1

    Avoiding a FileInUse access

    Hi,

    In my web service, it has to return an image from a file located at
    a specific virtual dir.
    Another concurrent app, running on the server, is periodically
    modifying that particular file.
    I'm now confronted with the fault situatiion that my client crashes
    the moment it tried to request that file while its being updated.
    Is there a way to circumvent this? I'm willing to wait for the file
    to be closed, but how to detect this remotely? Is there a method for
    this?
    THANKS!
    Saya
  • Michael Nemtsev

    #2
    Re: Avoiding a FileInUse access

    Hello Saya,


    I recomend to apply Cache and notification to get access to the file when
    it's changed

    Keep file cached and use delegate CacheItemRemove dCallback and create dependencies
    CacheDependency to the file on the hard drive.
    As only file updates u get notification and can read this file into cache.

    S> In my web service, it has to return an image from a file located at
    S> a specific virtual dir.
    S> Another concurrent app, running on the server, is periodically
    S> modifying that particular file.
    S> I'm now confronted with the fault situatiion that my client crashes
    S> the moment it tried to request that file while its being updated.
    S> Is there a way to circumvent this? I'm willing to wait for the file
    S> to be closed, but how to detect this remotely? Is there a method for
    S> this?


    ---
    WBR,
    Michael Nemtsev
    "At times one remains faithful to a cause only because its opponents do not
    cease to be insipid. (c) Friedrich Nietzsche"


    Comment

    • Marvin Smit

      #3
      Re: Avoiding a FileInUse access

      Hi,

      have you considered "extending" the ">Another concurrent app"?

      If you always get the images from that app (which seems to be the
      controller of it) it removes the 'seperate access to same file' and
      thereby removes the cause of this problem.

      Hope this helps,

      Marvin Smit.

      On Mon, 29 Aug 2005 16:16:13 +0200, Saya <> wrote:
      [color=blue]
      >Hi,
      >
      > In my web service, it has to return an image from a file located at
      >a specific virtual dir.
      >Another concurrent app, running on the server, is periodically
      >modifying that particular file.
      >I'm now confronted with the fault situatiion that my client crashes
      >the moment it tried to request that file while its being updated.
      > Is there a way to circumvent this? I'm willing to wait for the file
      >to be closed, but how to detect this remotely? Is there a method for
      >this?
      >THANKS!
      >Saya[/color]

      Comment

      Working...