avoid opening a dir. flush stdout