Fix track sorting used for dynamic .ptracks files containing time indices. Usually the original .ptracks file is overwritten by the sorted one, but on Windows file deletion may be blocked. As a workaround for this situation, the sorted .ptracks file is left as a separate file (only when it's not possible to do the deletion).
Side note: anywhere we use std::remove() or std::rename() may fail on Windows due to restricted permissions, we should be careful about checking that it succeeded.
Fix track sorting used for dynamic .ptracks files containing time indices. Usually the original .ptracks file is overwritten by the sorted one, but on Windows file deletion may be blocked. As a workaround for this situation, the sorted .ptracks file is left as a separate file (only when it's not possible to do the deletion).
Side note: anywhere we use
std::remove()
orstd::rename()
may fail on Windows due to restricted permissions, we should be careful about checking that it succeeded.