var mkdirp=require("../"),path=require("path"),fs=require("fs"),exists=fs.exists||path.exists,test=require("tap").test,_0777=parseInt("0777",8),_0755=parseInt("0755",8);test("rel",function(t){t.plan(5);var r=Math.floor(Math.random()*Math.pow(16,4)).toString(16),o=Math.floor(Math.random()*Math.pow(16,4)).toString(16),e=Math.floor(Math.random()*Math.pow(16,4)).toString(16),a=process.cwd();process.chdir("/tmp");var i=[r,o,e].join("/");mkdirp(i,_0755,function(r){t.ifError(r),exists(i,function(r){t.ok(r,"file created"),fs.stat(i,function(r,o){t.ifError(r),process.chdir(a),t.equal(o.mode&_0777,_0755),t.ok(o.isDirectory(),"target not a directory")})})})});