Re: Trouble moving directory
| From: | Jasper Bryant-Greene | Date: | Thu, 13 Oct 2005 02:17:27 +0000 |
| Subject: | Re: Trouble moving directory | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224006@lists.php.net to get a copy of this message | ||
-k. wrote:
I'm having trouble moving some directories. My script works fine on some directories but doesn't move others. It seems to have trouble with directories with non alphanumeric charters. I'm running Red Hat FC2. I'm trying to move the directory basically like this... <?Php $source_dir = '/some/dir/Dir That Won't Move/';$source_dir = escapeshellarg( '/some/dir/Dir That Won't Move/' );
$dest_dir = '/some/other/dir/';$dest_dir = escapeshellarg( '/some/other/dir/' );
$cmd = escapeshellcmd("mv ".$source_dir." ".$dest_dir); $result = shell_exec($cmd); ?> Is there some way to escape the characters in the directories? For example if i put a "\" in front of blank spaces it takes care of those (same for "'","(" etc.) but that obviously doesn't take care of everything. I'm hoping there is something easy i'm overlooking here that will escape all the characters.-- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/