Jump to content

fileWrite over-writing


Recommended Posts

Hey guys, i want to do filewrite at pos 120 in my script, without actually overwriting, so just adding stuff. But i cannot, it just overwrites stuff and fucks it up.

This is becouse i want to add custom definitions to my script, and if i add em on the end of it, it will not work.

Greetz

HyPeX

Link to comment

- Get everything until that position

- Get everything after that position

- add your stuff (like 1st half + new stuff + 2nd half)

- write it to a new file.

Anyway, I don't think you should actually modify a script file like this.

Link to comment

Get everything in the file as a string and put it on a variable. Get the position where you want to write and remove everything infront of that position and put that onto another variable. When you writed, paste the strings together and put them into a file (create a new file, overwrite it IF succeed) and save it.

I think there better ways to do it, but atleast you are sure it won't overwrite is if you do it like this...

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...