PC Review


Reply
Thread Tools Rate Thread

can you delete a file using FileStream?

 
 
not_a_commie
Guest
Posts: n/a
 
      7th Apr 2009
I have a file open with File.Open(give me all access rights, etc.).
After I read all the data and before releasing my lock on the file, I
want to delete it. I don't want any other processes getting access to
the file after I've read all the data and before I delete it. Any
ideas on how to do this? Currently I'm using the FileStream.SetLength
member to truncate the file to 0 bytes. I then delete the file after
releasing the lock. That's not quite perfect.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileStream GURU Help - Filestream and Icon files .NET SQL2000 Bob Microsoft ADO .NET 1 5th Apr 2004 05:55 PM
FileStream async access and FileStream locks Natalia DeBow Microsoft Dot NET 1 24th Mar 2004 08:38 AM
FileStream async access and FileStream.Lock Natalia DeBow Microsoft Dot NET Framework 1 23rd Mar 2004 11:17 PM
FileStream.Lock, FileStream.Unlock and its sync. John Microsoft C# .NET 0 11th Sep 2003 11:06 AM
FileStream.Lock, FileStream.Unlock and its sync. John Microsoft Dot NET 0 11th Sep 2003 11:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:24 AM.