Changeset 195


Ignore:
Timestamp:
Jun 1, 2006, 9:07:46 AM (18 years ago)
Author:
garonne
Message:

enhance realpath function

Location:
CMT/HEAD/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_system.cxx

    r193 r195  
    249249
    250250//--------------------------------------------------
    251 void CmtSystem::realpath (const cmt_string& path, cmt_string& result)
    252 {
    253   cmt_string here     = CmtSystem::pwd ();
    254   CmtSystem::cd (path);
    255   result              = CmtSystem::pwd ();
    256   CmtSystem::cd (here);
     251bool CmtSystem::realpath (const cmt_string& path, cmt_string& result)
     252{
     253  cmt_string here = CmtSystem::pwd ();
     254  if  (test_directory(path))
     255  {
     256      CmtSystem::cd (path);
     257      result = CmtSystem::pwd ();
     258      CmtSystem::cd (here);
     259      return true;
     260   }
     261   return false;
    257262}
    258263
  • CMT/HEAD/source/cmt_system.h

    r193 r195  
    3939
    4040  // Resolve symbolic links in a path.
    41   static void realpath (const cmt_string& path, cmt_string& result);
     41  static BOOL realpath (const cmt_string& path, cmt_string& result);
    4242
    4343  static void dirname (const cmt_string& file_name, cmt_string& result);
Note: See TracChangeset for help on using the changeset viewer.