Problem deleteing files

  • Thread starter Thread starter Emilio
  • Start date Start date
E

Emilio

Hi,

How can I find out what process are using a particular file, I want my users
to be able to delete obsolete images, html pages etc. But I always get an
error mentioning that the file file is being used by another process.I am
the only person working on a dev server and the images have been used to
provide me with a visual context of the contents of a folder.

Does IIS or asp.net hold them for a term after a request? How do I clear any
processes?

Many thanks

Emilio
 
Thanks Rajesh,

I'll give it a bash.

But what would be the best way to do this?

Create a xml file that can be used by the session end event and to compare
against when displaying directory images and just not display those that are
included so that the user can see that something has happened?

thanks again
 
The best solution would be to code in session_end event of global.asax and
delete the files in a try catch block. So that way u dont worry which
process is using it. As the process releases the lock the file gets deleted
eventually.

The othe solution is to use a schedular like the Autofire component.
 
Actually my post referred to :- on say if dir contains 10 files u want to
delete and some are locked. At least delete the balance files. And later on
delete the prev locked ones as well.

I am really not aware of ur app scenario to suggest a better way.....
 
Back
Top