| 1669 | } // tm2Str |
| 1670 | |
| 1671 | std::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 | |
| 1689 | int metacopy(const std::string& source, const std::string& tgt, Exiv2::ImageType targetType, bool preserve) { |
| 1690 | #ifdef EXIV2_DEBUG_MESSAGES |