Bug 13887 - System.Net.WebClient.DownloadData does not close file for a local URI
Summary: System.Net.WebClient.DownloadData does not close file for a local URI
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-08-09 10:49 UTC by Mathias
Modified: 2013-08-09 10:49 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Mathias 2013-08-09 10:49:37 UTC
If I pass a local file URI as a parameter to System.Net.WebClient.DownloadData(string uri), it returns the content correctly but does not close the file afterwards.

Example code:

var webclient = new System.Net.WebClient();
string uri = "file:///tmp/foo";
byte [] fooContent = webclient.DownloadData(url);

After running this, fooContent contains the data from /tmp/foo, but that file remains opened (in consequence causing an IOException if you want to write to it)

Note You need to log in before you can comment on or make changes to this bug.