Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I need some help with text files please.......

    ...Is it possible to have an area of a text file not be over written when i write to it in r+?

    I need a piece of text on a file to remain, even though the rest of the text file is over written.

    Thanks in advance.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,093
    Thanks
    11
    Thanked 101 Times in 99 Posts
    no, you can add to the end of an existing textfile with 'a+' but you cant get selective with that.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the viable workaround is to read the file into a string (or array of strings), grab the bit you want to keep, build a new insert string and write that to the file.
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •