write directory