How do I remove a directory that is not empty?

There is no built-in function to do this, but see the comments at the bottom of http://us3.php.net/rmdir. A number of commenters posted their own recursive directory deletion functions. You can take your pick from those. Here’s one that looks decent: function deleteDirectory($dir) { if (!file_exists($dir)) { return true; } if (!is_dir($dir)) { return unlink($dir); } … Read more

How to ‘Watch’ only a directory in a GitHub repository?

GitHub provides feeds that can do this for both directories and files.1 Using that syndication, a service like Blog Trottr can send you an email whenever the feed is updated. Some samples, taken from the Linux source code on master: Directory File Source on GitHub /Documentation /Documentation/Makefile History on GitHub /Documentation /Documentation/Makefile History Atom feed … Read more

How can my Perl script find its module in the same directory?

I am curious why the simplistic solution use File::Basename; use lib dirname (__FILE__); use SomeModuleLocatedInTheSameDirectoryAsThisPerlScriptOrModule; did not come up. The FindBin module seems to have some issues if the file is not the main executable perl script, but simply a non-executable Perl module. At least that’s how I interpret the comment in the documentation. Did … Read more

How do I find where ElasticSearch is installing my plugins?

To find your elasticsearch home directory & install plugin(s) follow these steps below. Locate your home directory ( Look for Settings -> Path -> Home for value ) $ curl “localhost:9200/_nodes/settings?pretty=true” Goto Location (Example settings.path.home value: /usr/local/Cellar/elasticsearch/1.5.0) $ cd /usr/local/Cellar/elasticsearch/1.5.0 Install Plugin (Example plugin: mobz/elasticsearch-head) $ bin/plugin -install mobz/elasticsearch-head

How do I delete a directory with read-only files in C#?

Simplest way of avoiding recursive calls is by utilising the AllDirectories option when getting FileSystemInfos, like so: public static void ForceDeleteDirectory(string path) { var directory = new DirectoryInfo(path) { Attributes = FileAttributes.Normal }; foreach (var info in directory.GetFileSystemInfos(“*”, SearchOption.AllDirectories)) { info.Attributes = FileAttributes.Normal; } directory.Delete(true); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)