php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15132 about FOpen
Submitted: 2002-01-20 21:40 UTC Modified: 2002-01-21 02:13 UTC
From: don at phice dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.1.1 OS: Non stated
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: don at phice dot com
New email:
PHP Version: OS:

 

 [2002-01-20 21:40 UTC] don at phice dot com
In the fopen function, the +r writes the file to the beginning of the file, correct? Now, I have a file with other content inside of that file. I want to add text, in front of that text, without messing with any of the original text. Is there already something that does this?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-21 02:13 UTC] torben@php.net
No, there isn't--for one thing, the system fopen() call 
won't do it. However, what you can do is create a new file
with a temporary name (see tempnam()), write your new 
content to it, append the contents of the original file, 
delete the original file, and rename the new file with the 
name of the original one.

BTW, you shouldn't use the bug database to ask questions; 
that's what the mailing lists are for. Using the bug 
database for this sort of thing just clogs it up...


Torben
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 01:01:33 2024 UTC