Files
tracy/util/CaptureFileBackup.hpp
Bartosz Taudul ebf5ebd9bd Replace the output file safely in tracy-capture.
The old pre-flight truncated the output at startup with -f, so an
interrupted capture lost the trace, and the probe fopen followed a
symlink. The existing file is now moved to FILE~ for the duration of
the capture and restored if the trace cannot be written.
2026-09-06 01:07:45 +02:00

24 lines
334 B
C++

#ifndef __CAPTUREFILEBACKUP_HPP__
#define __CAPTUREFILEBACKUP_HPP__
#include <stdint.h>
namespace tracy
{
enum class OutputPrep : uint8_t
{
Ok,
Exists,
Unusable
};
OutputPrep PrepareOutputFile( const char* path, bool overwrite, const char** error );
void RestoreOutputBackup();
void DiscardOutputBackup();
}
#endif