Add getDirectoryContents' which ignores "." and ".." - #36
Conversation
|
Perhaps instead of using a prime (which may be confused for other things), we could call it
I don't see any reason not to :P Thanks for the pull request! |
|
Thank you for your reply. I will amend the pull request to change the name to I also edited For the sake of simplifing the unit test, should we edit them to use |
|
I amended the initial commit to change the name to |
While that's fine for the other tests, for |
|
Thank you for merging it. Sorry I did not answer your complain about the unit test not covering I'll soon do another pull request to fix that (an some other stuff if time is available). |
Don't worry about that – it's all taken care of. Thanks for your contribution! |
|
Just a heads up in case you happen to be using HEAD: I've renamed |
Remove double quotes around searchPath elements on Windows
getDirectoryContents returns the "." and ".." special directories. However in most cases user do not care about theses values and must manually filter them. This pull request introduces the getDirectoryContents' variant which handle this filtering. I find this really convenient when working with directory listing. Other languages uses the same trick (such as python, with os.listdir(),
Discussion: should we update removeContentsRecursive to use getDirectoryContents' instead of the explicit manual filtering of "." and ".." ?