ups,ofstream::close should be called.