Jump to content

Deleting files


Crs

Recommended Posts

Hi, I gave the following php script:

 

#!/usr/bin/php -f
<?php
require_once(dirname(dirname(__FILE__))."/modules/common/common.config.inc.php");
$path = $conf["root"]."/media/images/tricouri/tmp/";
$command = "rm -Rf".$path."*";
if(exec($command))
{
    echo "Folder cleared\n";
}
else
{
    echo "Folder clear failed\n";
}
?>

 

I want to delete some .png files from the ./tmp folder and I receive a rm error:

rm: invalid option -- /

Try `rm --help' for more information.

Folder clear failed

 

The rm -rf command sintax is ok on the linux bash, but from php i receive the error.

Php safe mode is off. Can someone help, please ?

Link to comment
https://forums.phpfreaks.com/topic/210957-deleting-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.