Re: [PHP-DB] delete file contents (sorry if i posted this twice, problem with signing up)

2001-12-12 Thread Dobromir Velev

Hi,
the easiest way is to open the file in a write only mode.

$fp=fopen("/var/mail/myaccount","w");
$fclose($fp);

Here's an excerpt from http://www.php.net/manual/en/function.fopen.php

'w' - Open for writing only; place the file pointer at the beginning of the file and 
truncate the file to zero length. If the file
does not exist, attempt to create it.

Hope this helps

Dobromir Velev
Web Developer
http://www.websitepulse.com/


-Original Message-
From: DigitalKoala <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, December 11, 2001 19:09
Subject: [PHP-DB] delete file contents (sorry if i posted this twice, problem with 
signing up)


>Hi Everyone,
>
>I'm running a script that automatically reads lines from
>/var/mail/myaccount, parses the lines then insert specific items into a
>database this is in a loop
>
>What i want to do is then delete the contents of the file, but not the file
>itself...can you tell me the best way to do this?
>
>many thanks
>anna
>
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] delete file contents (sorry if i posted this twice, problem with signing up)

2001-12-11 Thread Miles Thompson

Anna,

Check the docs, but I believe if you fopen() with the "w" flag it 
overwrites the contents.

Miles

At 05:03 PM 12/11/2001 +, DigitalKoala wrote:
>Hi Everyone,
>
>I'm running a script that automatically reads lines from
>/var/mail/myaccount, parses the lines then insert specific items into a
>database this is in a loop
>
>What i want to do is then delete the contents of the file, but not the file
>itself...can you tell me the best way to do this?
>
>many thanks
>anna
>
>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Delete file

2001-07-10 Thread Kevin Johnson


http://www.php.net/manual/en/ref.filesystem.php


-Original Message-
From: andRie Is [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 3:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Delete file


Hello php-db,

  How to delete file using PHP ?
  and how to set it's permission ?

 ,,,   
(@-@)   
+==---o00(_)00o-==+

"It is better to be defeated on principle than to win on lies."
--Arthur Calwell
-- 
Best regards,
 andRie 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]