[posixdirectory] added missing code

Thanks @Karlson2k for the heads up.
I wouldn't merge while jenkins is broken.
It's good chance to improve this code to be more elegant.  :)