View Full Version : Stream to XML file
m2244
02-25-2010, 01:57 PM
I have some code that creates a XML file on the desktop. There is a "stream " command involved. If I leave the SWF open(actually it is an AIR application) I cannot open the XML file due to this streaming. If I x-out of the application I can then open the XML file. My question is should I worry about closing the stream in the code? What are the consequences of just x-ing-out?
Thanks again.
MH
NoobsArePeople2
02-25-2010, 04:03 PM
Is this stream you are referring to FileStream? If so, you should always close it (good practice). Also on Windows you run into the problem you mentioned with not being able to open the file (technically it's still open) or any other file in the same directory.
If your app will need to work with other files you should definitely close it. If it's more of a utility -- open it, write some file, close it -- I don't think it's a problem.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.