programmieren:php:programme:copsy_verzeichnis
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
programmieren:php:programme:copsy_verzeichnis [04/10/2020 15:04] – conny | programmieren:php:programme:copsy_verzeichnis [07/11/2021 12:29] (aktuell) – conny | ||
---|---|---|---|
Zeile 8: | Zeile 8: | ||
\\ | \\ | ||
<code php| subdir_copy.php> | <code php| subdir_copy.php> | ||
- | <?php | + | <?php |
/* | /* | ||
* by Conny Henn | * by Conny Henn | ||
+ | * source und dest Verzeichnis sollten existieren | ||
*/ | */ | ||
+ | |||
+ | $source = "/ | ||
+ | $dest = "/ | ||
+ | |||
+ | subdir_copy($source, | ||
+ | |||
function subdir_copy( $source, $dest ) { | function subdir_copy( $source, $dest ) { | ||
- | + | ||
- | if (!is_dir($source)){ | + | echo "< |
- | echo $source." | + | if (!is_dir($source)){ |
+ | echo "< | ||
return false; | return false; | ||
- | | + | } |
- | + | if (!is_dir($dest)){ | |
- | $shellBefehl = "cp -Rv $source $dest"; | + | echo "< |
- | | + | return false; |
- | | + | } |
- | | + | |
+ | echo "From : " | ||
+ | echo " | ||
+ | |||
+ | $shellBefehl = "cp -RvpT $source $dest >> | ||
+ | /** | ||
+ | * cp Parameter | ||
+ | * R rekursiv = mit Unterverzeichnissen | ||
+ | * v verbose = vergleichen | ||
+ | * p preserve = mode, | ||
+ | * T no-target-directory = keine Zielverzeichnis | ||
+ | */ | ||
+ | exec($shellBefehl, | ||
+ | var_dump($output, $retrun_var); | ||
} | } | ||
</ | </ |
programmieren:php:programme (271 views) · Zuletzt geändert: 07/11/2021 12:29 von conny