build directory remove from s3 file write