write to file not directory