~tes/goby/2.1-git

« back to all changes in this revision

Viewing changes to src/common/application_base.cpp

  • Committer: GitHub
  • Author(s): Toby Schneider
  • Date: 2017-03-02 19:36:56 UTC
  • mfrom: (645.1.2)
  • Revision ID: git-v1:e82d7c18df9ce8dba8b17e7deb41540af33719f8
Merge pull request #18 from tfabbri/canonicalize_filename_fix

BUG:canonicalize_file_name not supported on MAC OS

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
// along with Goby.  If not, see <http://www.gnu.org/licenses/>.
22
22
 
23
23
#include <boost/format.hpp>
 
24
#include <boost/filesystem.hpp>
24
25
 
25
26
#include "application_base.h"
26
27
#include "goby/common/configuration_reader.h"
120
121
           glog.is(DIE) && glog << die << "cannot write glog output to requested file: " << file_name << std::endl;
121
122
 
122
123
       remove(file_symlink.c_str());
123
 
       symlink(canonicalize_file_name(file_name.c_str()), file_symlink.c_str());
 
124
       namespace fs = boost::filesystem;
 
125
       fs::path canonicalized_file_name = fs::canonical(fs::path(file_name.c_str()), fs::path(file_symlink.c_str()));
 
126
       symlink(canonicalized_file_name.string().c_str(), file_symlink.c_str());       
124
127
        
125
128
       
126
129
       glog.add_stream(base_cfg_->glog_config().file_log(i).verbosity(), fout_[i].get());