473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem deleteing files

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
Nov 17 '05 #1
3 1192
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.

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
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

Nov 17 '05 #2
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
"Rajesh.V" <Ra***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
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


Nov 17 '05 #3
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.....

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...
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
"Rajesh.V" <Ra***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.

"Emilio" <emilio@@intellinova.com.NOSPAM> wrote in message
news:eZ**************@TK2MSFTNGP11.phx.gbl...
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



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lgbjr | last post by:
Hi All, I'm having a problem with a VB.NET project that I'm building in VS.NET 2003 (7.1.3088). As my project has increased in size (the executable is now about 2.5MB), I am experiencing a lot...
6
by: Nicros | last post by:
Hi, I have a simple project, with a main application and a static library. I call a function from one of the classes in the static lib, but during compile time I get the LNK2019 problem. ...
2
by: express99 | last post by:
i am new to perl scripting. i want to be able to delete folders and files older than n days recursively in a windows environment.
6
by: Smokey Grindle | last post by:
I need to ensure that there are NO files in the target folder of a setup project, I want to delete anything in the folder first before the install takes place (all from inside the installer program...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.