adding file to dir; opening buffer while creating file