Click here to Skip to main content
15,906,333 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 4:49
professionalChris Losinger6-Oct-06 4:49 
GeneralRe: bug in XmlReader ? Pin
Guffa6-Oct-06 10:04
Guffa6-Oct-06 10:04 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 10:38
professionalChris Losinger6-Oct-06 10:38 
GeneralRe: bug in XmlReader ? Pin
Guffa6-Oct-06 11:17
Guffa6-Oct-06 11:17 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 11:31
professionalChris Losinger6-Oct-06 11:31 
GeneralRe: bug in XmlReader ? Pin
Guffa6-Oct-06 12:18
Guffa6-Oct-06 12:18 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 12:31
professionalChris Losinger6-Oct-06 12:31 
GeneralRe: bug in XmlReader ? Pin
Guffa6-Oct-06 13:17
Guffa6-Oct-06 13:17 
Chris Losinger wrote:
it opened the file. if i wanted control of the file outside of the context of an XmlReader, i would've created a StreamReader and gave that to the XmlReader. but i didn't - i gave XmlReader a filename and it opened the file. let me repeat that: XmlReader opened the file.


Yes, you asked the reader to open the file. If you tell it to close it, it will. If you don't tell it to close it but leave it hanging in the middle of the process, it can't close the file as it doesn't know that you don't want to continue reading from it.

If you don't tell the reader that you don't want to use the file any more, how do you expect it to close the file?

my decision was made by the fact that i called the thing via the interface that implies "here, you handle the file operations, not me". i didn't give it an opened file. i gave it a filename.


Yes, and it does handle the file operations, according to the information that you give to the reader. If the reader has no information that you are done reading from the file, it can't close it.

i didn't say "open this file, do what you need, then leave it open for me"


Yes, you did. You opened it and stopped reading in the middle. Of course it stays open until you complete the read or closes it.

the XmlReader provides no way to get to that opened file once it's opened it, so your statement that i can "continue to read from it" is completly meaningless - XmlReader provides no access to the opened file stream.


It's not meaningless at all. You read from the file using the methods of the reader, it's irrelevant if you have direct access to the file or not.

It's exactly the same as with a stream. You use the methods of the stream to read from a file, but you never have direct access the the file.


---
b { font-weight: normal; }

GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 16:42
professionalChris Losinger6-Oct-06 16:42 
GeneralRe: bug in XmlReader ? Pin
Guffa7-Oct-06 1:47
Guffa7-Oct-06 1:47 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger7-Oct-06 3:50
professionalChris Losinger7-Oct-06 3:50 
GeneralRe: bug in XmlReader ? Pin
Colin Angus Mackay10-Oct-06 1:05
Colin Angus Mackay10-Oct-06 1:05 
AnswerRe: bug in XmlReader ? [modified] Pin
Dave Kreskowiak6-Oct-06 4:39
mveDave Kreskowiak6-Oct-06 4:39 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 4:55
professionalChris Losinger6-Oct-06 4:55 
QuestionConvert a collection into a list?? Pin
roxuca5-Oct-06 4:39
roxuca5-Oct-06 4:39 
AnswerRe: Convert a collection into a list?? Pin
Robert Rohde9-Oct-06 22:33
Robert Rohde9-Oct-06 22:33 
QuestionComplier Error Question Pin
Beringer5-Oct-06 3:42
Beringer5-Oct-06 3:42 
AnswerRe: Complier Error Question Pin
mr_lasseter5-Oct-06 4:48
mr_lasseter5-Oct-06 4:48 
QuestionAutomatic copying of dlls Pin
Seshadri Manivannan4-Oct-06 2:49
Seshadri Manivannan4-Oct-06 2:49 
AnswerRe: Automatic copying of dlls Pin
Dave Kreskowiak4-Oct-06 4:49
mveDave Kreskowiak4-Oct-06 4:49 
QuestionSystem.IO.FileNotFoundException: The specified module could not be found. Pin
Elena_2006oct4-Oct-06 2:47
Elena_2006oct4-Oct-06 2:47 
AnswerRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
S. Senthil Kumar6-Oct-06 6:13
S. Senthil Kumar6-Oct-06 6:13 
GeneralRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
Elena_2006oct6-Oct-06 6:43
Elena_2006oct6-Oct-06 6:43 
GeneralRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
S. Senthil Kumar6-Oct-06 19:03
S. Senthil Kumar6-Oct-06 19:03 
GeneralRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
Elena_2006oct8-Oct-06 22:13
Elena_2006oct8-Oct-06 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.