Afficher/masquer le menu
Liens Ecyseo
  • Tags cloud
  • Daily
  • Pictures wall
  • Search
  • Display options
    • Links per page :
    • 20 links
    • 50 links
    • 100 links
  • RSS Feed
  • Login

J'ai besoin d'intimité. Non pas parce que mes actions sont douteuses, mais parce que votre jugement et vos intentions le sont.

5166 links 

page 1 / 1

Liste des liens

6 results tagged dossier x
samba [Wiki ubuntu-fr]
2023-01-21 12:15 - permalink -

Tuto partage samba

dossier Linux partage samba ubuntu windows
- https://doc.ubuntu-fr.org/samba
CodePen Home File and Directory Drag-and-drop for Firefox and Chrome - Codepen - Le Hollandais Volant
2021-10-12 15:10 - permalink -
dossier javascript upload
- https://lehollandaisvolant.net/?mode=links&id=20211011183334
Folder Color • Marcos Costales
2021-08-16 12:27 - permalink -

Pour changer la couleur des dossiers sous linux. Un redémarrage de Nemo est nécessaire pour que le soft soit actif.

couleurs dossier Linux logiciel
- https://costales.github.io/projects/folder-color/
Executing a callback for all files in a directory
2019-08-20 13:10 - permalink -

Brillant !

/**
 * Allows running a callback on all files in a deep directory structure
 *
 * @author Aidan Lister <aidan@php.net>
 * @param string $dirname The directory to walk
 * @param callable $callable The callable to execute on all files found
 * @param mixed $arg{n} Extra parameters to be passed to the callable
 * @return mixed The return value of the last callable run
 */
function directory_walk($dirname, $callable)
{
    $ignore = array('.', '..', '.DS_Store');
    $args = func_get_args();
    array_shift($args);

    // Sanity check    
    if (!file_exists($dirname)) {
        return false;
    }

    // Create and iterate stack
    $stack = array($dirname);
    while ($entry = array_pop($stack)) {
        if (is_link($entry)) continue;

        // Run the action
        if (is_file($entry)) {
          $ret = call_user_func_array($callable, array($entry) + $args);
          continue;
        }

        // Add the directory into the stack
        $dh = opendir($entry);
        while (false !== $child = readdir($dh)) {
            if (in_array($child, $ignore)) continue;
            $child = $entry . DIRECTORY_SEPARATOR . $child;
            $stack[] = $child;
        }
        closedir($dh);
    }

    return $ret;
}

So, for some examples. We’ll start simple and simply print the directory:

$func = create_function('$file', 'echo "found $file";');
directory_walk('target-dir', $func);

Which for me outputs: found target-dir/foo found target-dir/bar found target-dir/baz found target-dir/baz/ding found target-dir/baz/dong found target-dir/baz/dong/witch

What if we wanted to add a .txt extension to all of these files? We could write:

function my_rename($entry, $extension) {
if (is_file($entry)) {
rename($entry, $entry . $extension);
}
}
directory_walk('target-dir', 'my_rename', '.txt');

Another example might be deleting all the .svn or CVS folders in a directory. We could write:

function delsvn($file) {
$ext = substr($file, strlen($file)-4,strlen($file));
if ($ext === '.svn') rmdirr($ext);
}
directory_walk('test', 'delsvn');

Note that the above example used the recursive delete function also.

Happy stacking.

dossier php
- http://www.aidanlister.com/2009/06/executing-a-callback-for-all-files-in-a-directory/
Déplacer ses dossiers personnels sous Linux | Numétopia
2019-05-28 18:4 - permalink -

À lire

dossier déplacement Linux
- https://www.numetopia.fr/deplacer-les-dossiers-personnels-sous-linux/
Utiliser Lsyncd pour synchroniser deux dossiers – Le blog de Seboss666
2017-09-6 21:34 - permalink -

Pour synchroniser deux dossiers sur une même machine ou sur 2 machines différentes. Peut-être sympa de voir pour l'utiliser avec un Bozon.

BoZon dossier Linux programme synchronisation
- https://blog.seboss666.info/2017/09/utiliser-lsyncd-pour-synchroniser-deux-dossiers/
page 1 / 1


Tags


  • shaarli
  • wikipedia

Tags cloud

Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation
Affiches "loi aviva" créées par Geoffrey Dorne le 13 Mai, 2020 - Mastodon 1 - Mastodon 2