File.Delete - UnauthorizedAccessException.

  • Thread starter Thread starter James Neave
  • Start date Start date
J

James Neave

Hi,

I have an app that holds a FileStream pointing to
/FlashDisk/Data/OSL.txt.
When the handheld performs a download, the data captured by my
application is loaded onto a PC via Bluetooth SPP.

But this file must be kept unique, created on the PC and deleted off
the HHC.

Thing is, no matter what I do, once the application is running, I
cannot delete the file. No matter what I Dispose, Close, Finalize,
Collect or Nullify, the file cannot be deleted programatically or
manually until the last line of the application passes and it ends.

Just so you know:

A static property holds a reference to a class which holds a reference
to a class which holds the StreamWriter, 'Reader and FileStream.
Several other classes get a reference to the OSL Writer through the
Static Property.

But even at the last line of code in the app, when every object has
been explicity Disposed, I still can't delete that file.

I'm still trying to recreate the problem in a simplified app, no luck
so far.

Regards,

James.
 
Have you tried a simple app that just creates, writes, close and delete the
file? Does that work?


For more info go to:
Mobility: http://msdn.microsoft.com/mobility
NETCF:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: (e-mail address removed) (James Neave)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: File.Delete - UnauthorizedAccessException.
| Date: 3 Aug 2004 08:45:40 -0700
| Organization: http://groups.google.com
| Lines: 31
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 195.173.198.98
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1091547941 11184 127.0.0.1 (3 Aug 2004
15:45:41 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Tue, 3 Aug 2004 15:45:41 +0000 (UTC)
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!p
ostnews2.google.com!not-for-mail
| Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.compactframework:58649
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi,
|
| I have an app that holds a FileStream pointing to
| /FlashDisk/Data/OSL.txt.
| When the handheld performs a download, the data captured by my
| application is loaded onto a PC via Bluetooth SPP.
|
| But this file must be kept unique, created on the PC and deleted off
| the HHC.
|
| Thing is, no matter what I do, once the application is running, I
| cannot delete the file. No matter what I Dispose, Close, Finalize,
| Collect or Nullify, the file cannot be deleted programatically or
| manually until the last line of the application passes and it ends.
|
| Just so you know:
|
| A static property holds a reference to a class which holds a reference
| to a class which holds the StreamWriter, 'Reader and FileStream.
| Several other classes get a reference to the OSL Writer through the
| Static Property.
|
| But even at the last line of code in the app, when every object has
| been explicity Disposed, I still can't delete that file.
|
| I'm still trying to recreate the problem in a simplified app, no luck
| so far.
|
| Regards,
|
| James.
|
 
Back
Top