Buschmaster Posted December 4, 2006 Share Posted December 4, 2006 Okay, so is there a way I can set fwrite to to replace a specific line?I know I could work around this by reading in the rest of the file right into the str_replace, but wouldn't that be bandwidth heavy?Thanks guys! Quote Link to comment Share on other sites More sharing options...
btherl Posted December 4, 2006 Share Posted December 4, 2006 That's what you'll have to do, unless your lines are of identical length. Files are stored on disk sequentially, so replacing a line means moving ALL the following data forward to fill up any newly created space, or moving ALL following data ahead to allow space for a larger line.Better ways of doing it depend on what your application needs to achieve. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.