Ensure group file directory exists when writing it