Register for your free account! | Forgot your password?

You last visited: Today at 12:34

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

Advertisement



File IO...

Discussion on File IO... within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
File IO...

What is the best way to delete some bytes that can be everywhere in a file?

Code:
FF FF 8F FF
By example, I want to delete the 8F... Sure, you can rewrite the file, but there is probably a better method...

In C/C++ or in C#...
CptSky is offline  
Old 02/12/2011, 00:06   #2
 
elite*gold: 0
Join Date: Sep 2006
Posts: 774
Received Thanks: 8,580
I don't think there is any other way.

Read the file into a buffer byte per byte until you reach the offset then skip it and continue and overwrite the file with your buffer.
phize is offline  
Old 02/12/2011, 04:38   #3
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
delete as in remove it from the file?

I may not be 100% correct on this, but ...

a file is an array of bytes, if you "delete" a byte, don't you need to shift the following bytes forward? that will suggest you re-writting the file. Even if there is a so called method/function to do it in one step, it probably has th re-writing part encapsulated.
shitboi is offline  
Old 02/13/2011, 20:34   #4


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
If no specific method exist, I will write one myself, but like you said, I don't think there is an other way to delete a part of a file.
CptSky is offline  
Reply


Similar Threads Similar Threads
anyone post here the file of editing file.. the .edf file
07/13/2013 - RF Online - 3 Replies
please post here... so that i can download again.. i guess the old one thread was gone.. i've been search for an hour in this section.. but i can't see it... thanks..
How to open mesh file and anim file(dekaron).PLZ~
02/15/2010 - Dekaron Private Server - 11 Replies
How to open mesh file and anim file(dekaron).PLZ~
pacth file ???(div file)launcher & auto updata!!
08/23/2009 - Dekaron Private Server - 7 Replies
Hi. I run the launcher and the client tries to patch The problem is to create a div A certain amount of data divided into two separate programs is split up the div? If you want to know what it's like ------------------------------------------------- ------------



All times are GMT +1. The time now is 12:34.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.