Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 15th, 2005, 11:37 PM   #1
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
file output question

How can I add a few bytes to the beginning of a file? Specifically, I want to change this file:

plane0 {
Properties 0 {
initialShadingGroup1 {
Name "initialShadingGroup1"
Filename "plane/plane_0"
Type 0 Prop
MaterialType 2 UNLIT
}
}

into this:

000plane0 {
Properties 0 {
initialShadingGroup1 {
Name "initialShadingGroup1"
Filename "plane/plane_0"
Type 0 Prop
MaterialType 2 UNLIT
}
}

by adding 000 at the beginning. Any ideas?
uman is offline   Reply With Quote
Old Feb 16th, 2005, 12:03 AM   #2
gardon
Programmer
 
Join Date: Dec 2004
Posts: 87
Rep Power: 4 gardon is on a distinguished road
Uh, why?
gardon is offline   Reply With Quote
Old Feb 16th, 2005, 12:10 AM   #3
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
It's a *really* long story. Can you please just tell me how to do it?
uman is offline   Reply With Quote
Old Feb 16th, 2005, 1:18 AM   #4
Xero
Hobbyist Programmer
 
Join Date: Dec 2004
Location: a cardboard box
Posts: 118
Rep Power: 4 Xero is on a distinguished road
I think theres a command for it. I'll check it out tommorrow.

But you could just copy the whole file into a linklist or something, clear the file, add the 000, write that stuff back in. But I think there may be an easier way as mentioned before.
__________________
...
Xero is offline   Reply With Quote
Old Feb 16th, 2005, 9:24 AM   #5
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
I have decided to just read in the whole file, write the "000", then write out the whole file. Thanks for the help, but I don't need it anymore.
uman is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC