MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / temporaryPath

Function temporaryPath

app/actions.cpp:1671–1687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1669} // tm2Str
1670
1671std::string temporaryPath() {
1672 static int count = 0;
1673 auto guard = std::scoped_lock(cs);
1674
1675#if defined(_WIN32)
1676 DWORD pid = ::GetCurrentProcessId();
1677#else
1678 pid_t pid = ::getpid();
1679#endif
1680 /// \todo check if we can use std::tmpnam
1681 auto p = fs::temp_directory_path() / (Exiv2::toString(pid) + "_" + std::to_string(count));
1682 if (fs::exists(p)) {
1683 fs::remove(p);
1684 }
1685
1686 return p.string();
1687}
1688
1689int metacopy(const std::string& source, const std::string& tgt, Exiv2::ImageType targetType, bool preserve) {
1690#ifdef EXIV2_DEBUG_MESSAGES

Callers 1

metacopyFunction · 0.85

Calls 1

toStringFunction · 0.85

Tested by

no test coverage detected