make directory checking more robust
make directory checking more robust

RJ/relx,tsloughter/relx,ingwinlu/relx,timclassic/relx,umatomba/relx,bsmr-erlang/relx,ethercrow/relx,bitwalker/relx,priestjim/relx,zugolosian/relx,lrascao/relx,Licenser/relx,erlware/relx,syl20bnr/relx