Using substr on a very large file

Discussion in 'PHP' started by thing2b, Jun 3, 2009.

  1. #1
    I have a very large file. I also have a memory limit on PHP and this file is larger than my memory limit.

    What I would like to do is append a multiline string to this very large file. I can do that.

    What I have problems with is that I want to check that the multiline string was appended. How would I do that with such a large file?

    If the multiline string is appended I then want to remove it (or I want to do nothing if the file has something unexpected in it). How can I do this?

    (I can do the above with a normal file, just not with a file greater than my PHP memory limit)
     
    thing2b, Jun 3, 2009 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Social.Network, Jun 3, 2009 IP