1059 |
|
|
1060 |
function safe_rename($fromdir,$fromfile,$tofile) { |
function safe_rename($fromdir,$fromfile,$tofile) { |
1061 |
function try_rename($from,$to) { |
function try_rename($from,$to) { |
1062 |
print "$from -> $to\n"; |
# print "$from -> $to\n"; |
1063 |
if (file_exists($from) && is_writeable(dirname($to))) { |
if (file_exists($from) && is_writeable(dirname($to))) { |
1064 |
rename($from,$to); |
rename($from,$to); |
1065 |
} |
} |
1075 |
$todir=dirname($to); |
$todir=dirname($to); |
1076 |
$tofile=basename($to); |
$tofile=basename($to); |
1077 |
|
|
1078 |
print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
# print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n"; |
1079 |
|
|
1080 |
try_rename("$fromdir/$fromfile","$todir/$tofile"); |
try_rename("$fromdir/$fromfile","$todir/$tofile"); |
1081 |
try_dir("$todir/.log"); |
try_dir("$todir/.log"); |