cpinput.php

<?php // Usage: cd SRC; pbpaste | sort | php cpinput.php DEST. $cwd = getcwd(); $dest = $argv[1]; $mode = 0777; while (($f = trim(fgets(STDIN)))) { if (is_dir("$cwd/$f")) { mkdir("$dest/$f", $mode, TRUE); } else { $dir = dirname($f); if (!is_dir("$dest/$dir")) { mkdir("$dest/$dir", $mode, TRUE); } copy("$cwd/$f", "$dest/$f"); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.