stat and pwd ported