Jump to content

[SOLVED] File Writing, replace on the go?


kratsg

Recommended Posts

some text file

name:foo
pass:bar
status:inactive
group:user

 

Some action occurs with the user, such as an email validation (I'm setting up an example, I'm NOT actually coding this... xD)

 

So, we read through the text file, when we approached "status:inactive" we change it to "status:active" and continue reading/updating the file...

 

some text file

name:foo
pass:bar
status:active
group:user

 

Is there a way we can accomplish this? Or must we read the file, manipulate what we've read, erase everything in the file, and copy the manipulated data back into the file?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.