edit in the file.

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 8
Reputation: tgsoon2002 is an unknown quantity at this point 
Solved Threads: 1
tgsoon2002 tgsoon2002 is offline Offline
Newbie Poster

edit in the file.

 
0
  #1
May 5th, 2009
As I read some tutorial, I just get the idea to input to the file totally replace, overwrite or continue at the end.
I wonder any code that in put text in the middle like this
brown
||
I want a V dog.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: edit in the file.

 
0
  #2
May 5th, 2009
It's impossible to insert more or less bytes in the middle of the file. Of course, you can overwrite some bytes - that's all.
As usually, file editors create new file and write new content to it, then rename or remove the old one and rename new file with the old file name.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 8
Reputation: tgsoon2002 is an unknown quantity at this point 
Solved Threads: 1
tgsoon2002 tgsoon2002 is offline Offline
Newbie Poster

Re: edit in the file.

 
0
  #3
May 6th, 2009
so the word program somekind like that?
They load all of them, after you edit, replace the old by the new one?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: edit in the file.

 
0
  #4
May 6th, 2009
Originally Posted by tgsoon2002 View Post
so the word program somekind like that?
They load all of them, after you edit, replace the old by the new one?
By the way, MS Word doc file is not a text file: DOC is a (proprietary) binary format.
Yes, it's (one of) possible text editor pattern. Variants:
1. see my post above (safe method)
2. read in memory, edit then overwrite old file from the first changed point (or from the start) to the end - see your post
Did you think that hard disk track is an elastic string which is capable to place additional inserted bytes into the middle of the file contents?
Last edited by ArkM; May 6th, 2009 at 3:36 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 8
Reputation: tgsoon2002 is an unknown quantity at this point 
Solved Threads: 1
tgsoon2002 tgsoon2002 is offline Offline
Newbie Poster

Re: edit in the file.

 
0
  #5
May 7th, 2009
oh yeah you don't tell, I fogot.
So any idea about this.
I have project to change
coding<=> diagram. Some kind like edit by drag and drop bunch of code, input values, type of it.
Hope you help
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 357 | Replies: 4
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC