Re: Rename

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

 



here a simple little cli script that has the guts of what youre
trying to accomplish.
NOTE: this is not a comprehensive solution :)

<?php
$srcDir = $argv[1];
$destDir = $argv[2];

if(is_dir($srcDir) && is_dir($destDir)) {
    $dirHandle = opendir($srcDir);
    while($curFile = readdir($dirHandle)) {
        if(empty($curFile) || $curFile == '.' || $curFile == '..') {
            continue;
        }
        rename("$srcDir/$curFile", "$destDir/$curFile");
    }
}
?>

-nathan

[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