Hi list,

I have scoured the archives with no good game plans.

Here is what I am trying to accomplish:

dump a table to a file on my server:
$sql = "SELECT * INTO OUTFILE '/tmp/test.txt' FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n' FROM table_name";

take the file and email it to someone:
using a mime-mail class from http://phpclasses.upperdesign.com

The above works perfectly.  I am able to create the file and email it to a
designated address.

Problem is that once I have created the dump file, it will not allow me to
overwrite it and it gives me an error.  Error = rm: cannot unlink
`test.txt': Operation not permitted.  It is owned by mysql:mysql.  So it
looks like it must be deleted by root or I need to change the ownership of
the file so it can be deleted.  So...

What is the best way to remove the file before re-dumping it to the /tmp
directory?  I'm not sure if it is possible to switch to root...but I know
that is probably a very bad idea.  How can I change the ownership of the
file so it can be deleted from PHP code?

TIA,

Scott

P.S.  Please cc: me on any responses as I am no longer a member of the list.


-- 
PHP General 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]

Reply via email to