Bin a directory into a object