Re: Trouble moving directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux