Problem deleteing files

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
 
E

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
 
R

Rajesh.V

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.
 
R

Rajesh.V

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.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top