Help required for Creation/Deletion/Append of Files in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
umesh
Forum Newbie
Posts: 2
Joined: Wed Jul 24, 2002 10:37 am
Contact:

Help required for Creation/Deletion/Append of Files in php

Post by umesh »

:? I require help for php listings as i am unable to append/delete files on apache server under linux. I tried unlink for deletion and fwrite "w+" for append. Will u be able to help me
User avatar
cwcollins
Forum Commoner
Posts: 79
Joined: Thu May 16, 2002 3:51 pm
Location: Milwaukee, WI, USA

Post by cwcollins »

Hey,
please provide a little more information. are you getting an error? what error? do you have permission to madofy the file(s) your're trying to work with?
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

One thing to note is that 'a' (or 'a+', for read-append) is the mode used to append files--not 'w+', which opens for read-write, but first erases all the data.
User avatar
musashi
Forum Commoner
Posts: 39
Joined: Tue Jul 23, 2002 12:51 pm
Location: Santa Cruz - CA

Permission

Post by musashi »

Umesh, check your file permissions too. Gnu2php is right, though. "w+" will delete the contents of the file the moment you use fopen.
Post Reply