Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 03:48

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help]When reading/writing from a file

Discussion on [Help]When reading/writing from a file within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2007
Posts: 340
Received Thanks: 38
[Help]When reading/writing from a file

Hello guys...I have 1 or 2 question about reading and writing from a file.

Reading:
After you have read all the infos from the file you use
filestream.close();
binaryreader.close

I am wondering...if I insert a filstream.flush() (before filestream.close()) does it have any effect? or is it necessary in reading a file? (as the flush() void says it clears all buffers and causes any buffered data to be writen to the file)

Writing:
OK as above I am wondering If it's necessary that a filestream.flush() and a binarywriter.flush() to exist before the files close.

General:
How about disposing (not sure what it is but it says that it releases all the resources being used by the stream)
Would it be any good to insert a filestream/binarywriter/binaryreader.dispose()? If so before or after the file closes?
ryuchetval is offline  
Old 10/07/2010, 09:37   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
You can't dispose if it's already closed.

The way I understand it is that it just frees up memory resources and such (which afaik C# will do by itself with garbage collection.. but I could be wrong)

Flush basically just finishes up whatever is happening afaik (so if you're in the middle of writing something then it will finish writing before closing). I could be wrong though. I really don't do much with file I/O
pro4never is offline  
Old 10/07/2010, 10:23   #3
 
elite*gold: 0
Join Date: Feb 2007
Posts: 340
Received Thanks: 38
Well I already use a GC.Collect() for the resources but it has no effect as far as I see...how about setting the value of the stream/reader/writer to null after it closes...would it have any effect?
ryuchetval is offline  
Old 10/08/2010, 00:53   #4
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Close flushes the buffer and also disposes of the object.

_tao4229_ is offline  
Reply


Similar Threads Similar Threads
[Source] Memory Reading / Writing SRO / VB6
07/07/2011 - SRO Hacks, Bots, Cheats & Exploits - 3 Replies
here is a simple source i made to show a buddy of mine how to call the read and write memory functions in vb6. right now it will call target / hp / mp ... you may want to update the offsets. this is a good example to show those out ther that want to learn. please if you use my code's give me credit /./
[HELP]Writing and reading from *.ini files
02/18/2009 - CO2 Programming - 2 Replies
i was trying to do that by myself but after 3days i must say that i cant do it :mad: sooo i will be very happy if somebody could help me with it :) thanks :)
Reading and Writing .INI Files
11/16/2008 - General Coding - 2 Replies
CodeGuru: CIniFile - Class for Reading and Writing .INI Files I found this information useful for starting out on understanding more about the code for read/write ini files. Maybe this will help some others (That are willing to read) :D enjoy
memory reading and writing problem
08/11/2006 - Conquer Online 2 - 3 Replies
hello all, i learnt to use C++ recently and is trying to write my own little proggy to monitor values in game. Right now i came across a little problem. i can't make my program read the memory addresses. Can someone please tell me the code to reading memory addresses for their values and also the relevant header files to use. Additional info: the memory editor i used give me this type of address, eg : 000A09E4, 009207C8. 00BF0EE0 ... Pros please help. i really want to have a feel...



All times are GMT +1. The time now is 03:49.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.