Overwriting a file that is in use.

woogiee

New member
Joined
Aug 31, 2005
Messages
2
Programming Experience
3-5
Hi, I have a peice of code that is creating a csv file from information i have stored in sql server. My problem is I need to be able to overwrite this same file with updated information every 2 hours or so, problem is that people could be using this file when i do this and when that happens i get an exception saying that the file is in use. My question is: Is there anyway to force the re-creation of the file even if someone has it open? -Ed
 
Nope... it's a windows thing.... When it is opened, it locks it so that i can't be deleted or overwritten.

-tg
 
Moreover what is the purpose of overwritting the file if someone already takes (or already has taken) data from it ... i hope you know for what i'm talking about. Or I don't get your idea? Again ?
dontknow.gif


Regards ;)
 
kulrom said:
Moreover what is the purpose of overwritting the file if someone already takes (or already has taken) data from it ... i hope you know for what i'm talking about. Or I don't get your idea? Again ?
dontknow.gif


Regards ;)

Basically all i am doing is exporting some totals from sql server to flat excel file that users will access from IIS. I realize this isn't the best way to do things but its sort of a temporary fix for something that is out of my hands, if I had my way i would be generating the excel file on the fly. Basically my only concern is that someone could have the file open in there browser instead of saved locally as a copy to there hard drive therefore causing the error that i am getting. But since it is a windows issue like techknome tells me then i guess i will just have to do it another way. Thank you everyone for your help, and i am sure i will be talking to you soon
 
Back
Top