<?php function RecursiveMkdir($path) { // This function creates the specified directory using mkdir(). Note // that the recursive feature on mkdir() is broken with PHP 5.0.4 for // Windows, so I have to do the recursion myself. if (!file_exists($path)) { // The directory doesn't exist. Recurse, passing in the parent // directory so that it gets created. RecursiveMkdir(dirname($path)); mkdir($path, 0777); } } $fichier =
"/path/to/my/file";
if (!file_exists($fichier)) { // Call the recursive mkdir function since the "recursive" feature // built in to mkdir() is broken. RecursiveMkdir(d
irname(
$fichier
)); // Vu que je suis sous linux je peux faire ça: System('touch '.
$fichier); // Fichier créé !
} En espérant que ça aide certains ! ?>
<?php function RecursiveMkdir($path) { // This function creates the specified directory using mkdir(). Note // that the recursive feature on mkdir() is broken with PHP 5.0.4 for // Windows, so I have to do the recursion myself. if (!file_exists($path)) { // The directory doesn't exist. Recurse, passing in the parent // directory so that it gets created. RecursiveMkdir(dirname($path)); mkdir($path, 0777); } } if (!file_exists("/path/to/my/file")) { // Call the recursive mkdir function since the "recursive" feature // built in to mkdir() is broken. RecursiveMkdir("/path/to/my/file"); } ?> Je testerai ça ce soir
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question