// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2014 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "dated_copy.h" #include "dirname.h" #include "basename.h" #include #include #include #include #include #if !defined(_WIN32) #include IGL_INLINE bool igl::dated_copy(const std::string & src_path, const std::string & dir) { using namespace std; // Get time and date as string char buffer[80]; time_t rawtime; struct tm * timeinfo; time (&rawtime); timeinfo = localtime (&rawtime); // ISO 8601 format with hyphens instead of colons and no timezone offset strftime (buffer,80,"%Y-%m-%dT%H-%M-%S",timeinfo); string src_basename = basename(src_path); string dst_basename = src_basename+"-"+buffer; string dst_path = dir+"/"+dst_basename; cerr<<"Saving binary to "<