I made attempt to use boost's filesystem on Novell NetWare (Metrowerks
CodeWarrior compiler). See attached patch to boost 1.30.0 below.

   - Petr Ovchenkov

diff -c -r -x CVS boost_1_30_0/libs/filesystem/src/exception.cpp boost/libs/filesystem/src/exception.cpp
*** boost_1_30_0/libs/filesystem/src/exception.cpp	Wed May 14 13:07:42 2003
--- boost/libs/filesystem/src/exception.cpp	Wed May 14 17:38:08 2003
***************
*** 33,38 ****
--- 33,40 ----
  # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
  #   if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
  #     define BOOST_WINDOWS
+ #   elif defined(N_PLAT_NLM)
+ #     define BOOST_NETWARE
  #   else
  #     define BOOST_POSIX
  #   endif
***************
*** 119,125 ****
      { ENOTDIR, fs::not_directory_error },
      { EAGAIN, fs::busy_error },
      { EBUSY, fs::busy_error },
! #       ifndef N_PLAT_NLM
      { ETXTBSY, fs::busy_error },
  #       endif
      { EEXIST, fs::already_exists_error },
--- 121,127 ----
      { ENOTDIR, fs::not_directory_error },
      { EAGAIN, fs::busy_error },
      { EBUSY, fs::busy_error },
! #       ifndef BOOST_NETWARE
      { ETXTBSY, fs::busy_error },
  #       endif
      { EEXIST, fs::already_exists_error },
***************
*** 236,246 ****
      {
        int system_error_code() // artifact of POSIX and WINDOWS error reporting
        {
!   #   ifdef BOOST_WINDOWS
          return ::GetLastError();
!   #   else
          return errno; // GCC 3.1 won't accept ::errno
!   #   endif
        }
      } // namespace detail
    } // namespace filesystem
--- 238,248 ----
      {
        int system_error_code() // artifact of POSIX and WINDOWS error reporting
        {
! #   ifdef BOOST_WINDOWS
          return ::GetLastError();
! #   else
          return errno; // GCC 3.1 won't accept ::errno
! #   endif
        }
      } // namespace detail
    } // namespace filesystem
Only in boost_1_30_0/libs/filesystem/src: exception.cpp~
diff -c -r -x CVS boost_1_30_0/libs/filesystem/src/operations_posix_windows.cpp boost/libs/filesystem/src/operations_posix_windows.cpp
*** boost_1_30_0/libs/filesystem/src/operations_posix_windows.cpp	Tue Feb  4 17:22:32 2003
--- boost/libs/filesystem/src/operations_posix_windows.cpp	Wed May 14 17:36:47 2003
***************
*** 37,42 ****
--- 37,44 ----
  # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
  #   if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
  #     define BOOST_WINDOWS
+ #   elif defined(N_PLAT_NLM)
+ #     define BOOST_NETWARE
  #   else
  #     define BOOST_POSIX
  #   endif
***************
*** 55,60 ****
--- 57,65 ----
  #   include "dirent.h"
  #   include "unistd.h"
  #   include "fcntl.h"
+ #   ifdef BOOST_NETWARE
+ #     include "nwfattr.h"
+ #   endif
  # endif
  
  #include <string>
***************
*** 66,72 ****
  
  namespace
  {
! #ifdef BOOST_POSIX
  
  # define BOOST_HANDLE DIR *
  # define BOOST_INVALID_HANDLE_VALUE 0
--- 71,77 ----
  
  namespace
  {
! #if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
  
  # define BOOST_HANDLE DIR *
  # define BOOST_INVALID_HANDLE_VALUE 0
***************
*** 259,265 ****
  
      bool exists( const path & ph )
      {
! #   ifdef BOOST_POSIX
        struct stat path_stat;
        return ::stat( ph.string().c_str(), &path_stat ) == 0;  
  #   else
--- 264,270 ----
  
      bool exists( const path & ph )
      {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
        struct stat path_stat;
        return ::stat( ph.string().c_str(), &path_stat ) == 0;  
  #   else
***************
*** 269,275 ****
  
      bool is_directory( const path & ph )
      {
! #   ifdef BOOST_POSIX
        struct stat path_stat;
        if ( ::stat( ph.native_directory_string().c_str(), &path_stat ) != 0 )
          boost::throw_exception( filesystem_error(
--- 274,280 ----
  
      bool is_directory( const path & ph )
      {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
        struct stat path_stat;
        if ( ::stat( ph.native_directory_string().c_str(), &path_stat ) != 0 )
          boost::throw_exception( filesystem_error(
***************
*** 288,294 ****
  
      bool _is_empty( const path & ph )
      {
! #   ifdef BOOST_POSIX
        struct stat path_stat;
        if ( ::stat( ph.string().c_str(), &path_stat ) != 0 )
          boost::throw_exception( filesystem_error(
--- 293,299 ----
  
      bool _is_empty( const path & ph )
      {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
        struct stat path_stat;
        if ( ::stat( ph.string().c_str(), &path_stat ) != 0 )
          boost::throw_exception( filesystem_error(
***************
*** 317,322 ****
--- 322,329 ----
  #   ifdef BOOST_POSIX
        if ( ::mkdir( dir_path.native_directory_string().c_str(),
          S_IRWXU|S_IRWXG|S_IRWXO ) != 0 )
+ #   elif defined(BOOST_NETWARE)
+       if ( ::mkdir( dir_path.native_directory_string().c_str() ) != 0 )
  #   else
        if ( !::CreateDirectoryA( dir_path.native_directory_string().c_str(), 0 ) )
  #   endif
***************
*** 329,335 ****
      {
        if ( exists( ph ) )
        {
! #   ifdef BOOST_POSIX
          if ( ::remove( ph.string().c_str() ) != 0 )
          {
  #   else
--- 336,342 ----
      {
        if ( exists( ph ) )
        {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
          if ( ::remove( ph.string().c_str() ) != 0 )
          {
  #   else
***************
*** 361,367 ****
      void rename( const path & old_path,
                   const path & new_path )
      {
! #   ifdef BOOST_POSIX
        if ( exists( new_path ) // POSIX is too permissive so must check
          || ::rename( old_path.string().c_str(), new_path.string().c_str() ) != 0 )
  #   else
--- 368,374 ----
      void rename( const path & old_path,
                   const path & new_path )
      {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
        if ( exists( new_path ) // POSIX is too permissive so must check
          || ::rename( old_path.string().c_str(), new_path.string().c_str() ) != 0 )
  #   else
***************
*** 375,381 ****
      void copy_file( const path & from_file_ph,
                      const path & to_file_ph )
      {
! #   ifdef BOOST_POSIX
        // TODO: Ask POSIX experts if this is the best way to copy a file
  
        const std::size_t buf_sz = 32768;
--- 382,388 ----
      void copy_file( const path & from_file_ph,
                      const path & to_file_ph )
      {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
        // TODO: Ask POSIX experts if this is the best way to copy a file
  
        const std::size_t buf_sz = 32768;
***************
*** 413,420 ****
  
      path current_path()
      {
! #   ifdef BOOST_POSIX
        long path_max = ::pathconf( ".", _PC_PATH_MAX );
        if ( path_max < 1 )
          boost::throw_exception(
            filesystem_error( "boost::filesystem::current_path",
--- 420,431 ----
  
      path current_path()
      {
! #   if defined(BOOST_POSIX) || defined(BOOST_NETWARE)
! #     ifdef BOOST_POSIX
        long path_max = ::pathconf( ".", _PC_PATH_MAX );
+ #     else
+       long path_max = _MAX_PATH;
+ #     endif
        if ( path_max < 1 )
          boost::throw_exception(
            filesystem_error( "boost::filesystem::current_path",
diff -c -r -x CVS boost_1_30_0/libs/filesystem/src/path_posix_windows.cpp boost/libs/filesystem/src/path_posix_windows.cpp
*** boost_1_30_0/libs/filesystem/src/path_posix_windows.cpp	Sat Jan  4 18:06:39 2003
--- boost/libs/filesystem/src/path_posix_windows.cpp	Wed May 14 17:44:26 2003
***************
*** 20,28 ****
  //****************************************************************************//
  
  // BOOST_POSIX or BOOST_WINDOWS specify which API to use.
! # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
  #   if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
  #     define BOOST_WINDOWS
  #   else
  #     define BOOST_POSIX
  #   endif
--- 20,30 ----
  //****************************************************************************//
  
  // BOOST_POSIX or BOOST_WINDOWS specify which API to use.
! # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) && !defined(BOOST_NETWARE)
  #   if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
  #     define BOOST_WINDOWS
+ #   elif defined(N_PLAT_NLM)
+ #     define BOOST_NETWARE
  #   else
  #     define BOOST_POSIX
  #   endif
***************
*** 58,69 ****
      if ( end_pos && str[end_pos-1] == '/' ) return end_pos-1;
      
      std::string::size_type pos( str.find_last_of( '/', end_pos-1 ) );
! #   ifdef BOOST_WINDOWS
      if ( pos == std::string::npos ) pos = str.find_last_of( ':', end_pos-2 );
  #   endif
  
      return ( pos == std::string::npos // path itself must be a leaf (or empty)
! #     ifdef BOOST_WINDOWS
        || (pos == 1 && str[0] == '/') // or share
  #     endif
        ) ? 0 // so leaf is entire string
--- 60,71 ----
      if ( end_pos && str[end_pos-1] == '/' ) return end_pos-1;
      
      std::string::size_type pos( str.find_last_of( '/', end_pos-1 ) );
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
      if ( pos == std::string::npos ) pos = str.find_last_of( ':', end_pos-2 );
  #   endif
  
      return ( pos == std::string::npos // path itself must be a leaf (or empty)
! #     if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE) 
        || (pos == 1 && str[0] == '/') // or share
  #     endif
        ) ? 0 // so leaf is entire string
***************
*** 75,95 ****
      target = ""; // VC++ 6.0 doesn't have string::clear()
      std::string::const_iterator itr( src.begin() );
  
! #   ifdef BOOST_WINDOWS
      // deal with //share
      if ( src.size() >= 2 && src[0] == '/' && src[1] == '/' )
        { target = "//"; itr += 2; }
  #   endif
  
      while ( itr != src.end()
! #     ifdef BOOST_WINDOWS
        && *itr != ':'
  #     endif
        && *itr != '/' ) { target += *itr++; }
  
      if ( itr == src.end() ) return;
  
! #   ifdef BOOST_WINDOWS
      if ( *itr == ':' )
      {
        target += *itr++;
--- 77,97 ----
      target = ""; // VC++ 6.0 doesn't have string::clear()
      std::string::const_iterator itr( src.begin() );
  
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
      // deal with //share
      if ( src.size() >= 2 && src[0] == '/' && src[1] == '/' )
        { target = "//"; itr += 2; }
  #   endif
  
      while ( itr != src.end()
! #     if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
        && *itr != ':'
  #     endif
        && *itr != '/' ) { target += *itr++; }
  
      if ( itr == src.end() ) return;
  
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
      if ( *itr == ':' )
      {
        target += *itr++;
***************
*** 209,215 ****
        std::string::const_iterator itr( src.begin() );
  
        // [root-filesystem]
! #     ifdef BOOST_WINDOWS
        if ( context != generic && src.size() >= 2 )
        {
          // drive or device
--- 211,217 ----
        std::string::const_iterator itr( src.begin() );
  
        // [root-filesystem]
! #     if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
        if ( context != generic && src.size() >= 2 )
        {
          // drive or device
***************
*** 234,247 ****
  
        // root directory [ "/" ]
        if ( itr != src.end() && (*itr == '/'
! #         ifdef BOOST_WINDOWS
            || (*itr == '\\' && context == platform)
  #         endif
            ) )
        {
          ++itr;
          if ( m_path.size() == 0
! #         ifdef BOOST_WINDOWS
            || m_path[m_path.size()-1] == ':' // drive or device
            || (  // share
               m_path.size() > 2
--- 236,249 ----
  
        // root directory [ "/" ]
        if ( itr != src.end() && (*itr == '/'
! #         if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
            || (*itr == '\\' && context == platform)
  #         endif
            ) )
        {
          ++itr;
          if ( m_path.size() == 0
! #         if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
            || m_path[m_path.size()-1] == ':' // drive or device
            || (  // share
               m_path.size() > 2
***************
*** 266,272 ****
          {
            if ( m_path.size() >= 2 // there is a named parent directory present
              && *(m_path.end()-1) == '/'
! #           ifdef BOOST_WINDOWS
              && *(m_path.end()-2) != ':'
  #           endif
              && *(m_path.end()-2) != '.' )    
--- 268,274 ----
          {
            if ( m_path.size() >= 2 // there is a named parent directory present
              && *(m_path.end()-1) == '/'
! #           if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
              && *(m_path.end()-2) != ':'
  #           endif
              && *(m_path.end()-2) != '.' )    
***************
*** 275,281 ****
              std::string::iterator child( m_path.end()-2 );
  
              while ( child != m_path.begin() && *child != '/'
! #             ifdef BOOST_WINDOWS
                && *child != ':'
  #             endif
                ) --child;
--- 277,283 ----
              std::string::iterator child( m_path.end()-2 );
  
              while ( child != m_path.begin() && *child != '/'
! #             if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
                && *child != ':'
  #             endif
                ) --child;
***************
*** 283,289 ****
              // only erase '/' if it is a separator rather than part of the root
              if ( (*child == '/'
                && (child == m_path.begin()
! #             ifdef BOOST_WINDOWS
                  || *(child-1) == ':'))
                || *child == ':'
  #             else                           
--- 285,291 ----
              // only erase '/' if it is a separator rather than part of the root
              if ( (*child == '/'
                && (child == m_path.begin()
! #             if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
                  || *(child-1) == ':'))
                || *child == ':'
  #             else                           
***************
*** 303,309 ****
            do
              { name += *itr; }
            while ( ++itr != src.end() && *itr != '/'
! #           ifdef BOOST_WINDOWS
              && (*itr != '\\' || context != platform)
  #           endif
              );
--- 305,311 ----
            do
              { name += *itr; }
            while ( ++itr != src.end() && *itr != '/'
! #           if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
              && (*itr != '\\' || context != platform)
  #           endif
              );
***************
*** 321,327 ****
          if ( itr != src.end() )
          {
            if ( *itr == '/'
! #         ifdef BOOST_WINDOWS
            || (*itr == '\\' && context == platform)
  #         endif
            ) ++itr;
--- 323,329 ----
          if ( itr != src.end() )
          {
            if ( *itr == '/'
! #         if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
            || (*itr == '\\' && context == platform)
  #         endif
            ) ++itr;
***************
*** 338,344 ****
  
      std::string path::native_file_string() const
      {
! #   ifdef BOOST_WINDOWS
        std::string s( m_path );
        for ( std::string::iterator itr( s.begin() );
          itr != s.end(); ++itr )
--- 340,346 ----
  
      std::string path::native_file_string() const
      {
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
        std::string s( m_path );
        for ( std::string::iterator itr( s.begin() );
          itr != s.end(); ++itr )
***************
*** 384,390 ****
            &&
            (
              len == 1 // "/"
! #       ifdef BOOST_WINDOWS
              || ( len > 1
                   && ( s[len-2] == ':' // drive or device
                     || ( s[0] == '/'   // share
--- 386,392 ----
            &&
            (
              len == 1 // "/"
! #       if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
              || ( len > 1
                   && ( s[len-2] == ':' // drive or device
                     || ( s[0] == '/'   // share
***************
*** 413,419 ****
        std::string::size_type pos( 0 );
        if ( m_path.size() && m_path[0] == '/' )
        { pos = 1;
! #     ifdef BOOST_WINDOWS
          if ( m_path.size()>1 && m_path[1] == '/' ) // share
          {
            if ( (pos = m_path.find( '/', 2 )) != std::string::npos ) ++pos;
--- 415,421 ----
        std::string::size_type pos( 0 );
        if ( m_path.size() && m_path[0] == '/' )
        { pos = 1;
! #     if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
          if ( m_path.size()>1 && m_path[1] == '/' ) // share
          {
            if ( (pos = m_path.find( '/', 2 )) != std::string::npos ) ++pos;
***************
*** 431,437 ****
  
      std::string path::root_name() const
      {
! #   ifdef BOOST_WINDOWS
        std::string::size_type pos( m_path.find( ':' ) );
        if ( pos != std::string::npos ) return m_path.substr( 0, pos+1 );
        if ( m_path.size() > 2 && m_path[0] == '/' && m_path[1] == '/' )
--- 433,439 ----
  
      std::string path::root_name() const
      {
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
        std::string::size_type pos( m_path.find( ':' ) );
        if ( pos != std::string::npos ) return m_path.substr( 0, pos+1 );
        if ( m_path.size() > 2 && m_path[0] == '/' && m_path[1] == '/' )
***************
*** 447,453 ****
      {
        return std::string(
          ( m_path.size() && m_path[0] == '/' )  // covers both "/" and "//share"
! #       ifdef BOOST_WINDOWS
            || ( m_path.size() > 2
                 && m_path[1] == ':'
                 && m_path[2] == '/' )  // "c:/"
--- 449,455 ----
      {
        return std::string(
          ( m_path.size() && m_path[0] == '/' )  // covers both "/" and "//share"
! #       if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
            || ( m_path.size() > 2
                 && m_path[1] == ':'
                 && m_path[2] == '/' )  // "c:/"
***************
*** 458,464 ****
      path path::root_path() const
      {
        return path(
! #   ifdef BOOST_WINDOWS
          root_name(), native ) /= root_directory();
  #   else
          root_directory() );
--- 460,466 ----
      path path::root_path() const
      {
        return path(
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
          root_name(), native ) /= root_directory();
  #   else
          root_directory() );
***************
*** 469,475 ****
  
      bool path::is_complete() const
      {
! #   ifdef BOOST_WINDOWS
        return m_path.size() > 2
          && ( (m_path[1] == ':' && m_path[2] == '/') // "c:/"
            || (m_path[0] == '/' && m_path[1] == '/') // "//share"
--- 471,477 ----
  
      bool path::is_complete() const
      {
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
        return m_path.size() > 2
          && ( (m_path[1] == ':' && m_path[2] == '/') // "c:/"
            || (m_path[0] == '/' && m_path[1] == '/') // "//share"
***************
*** 483,489 ****
      {
        return ( m_path.size() 
                 && m_path[0] == '/' )  // covers both "/" and "//share"
! #            ifdef BOOST_WINDOWS
                 || ( m_path.size() > 1 && m_path[1] == ':' ) // "c:" and "c:/"
                 || ( m_path.size() > 3
                      && m_path[m_path.size()-1] == ':' ) // "device:"
--- 485,491 ----
      {
        return ( m_path.size() 
                 && m_path[0] == '/' )  // covers both "/" and "//share"
! #            if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
                 || ( m_path.size() > 1 && m_path[1] == ':' ) // "c:" and "c:/"
                 || ( m_path.size() > 3
                      && m_path[m_path.size()-1] == ':' ) // "device:"
***************
*** 493,499 ****
  
      bool path::has_root_name() const
      {
! #   ifdef BOOST_WINDOWS
        return m_path.size() > 1
          && ( m_path[1] == ':' // "c:"
            || m_path[m_path.size()-1] == ':' // "prn:"
--- 495,501 ----
  
      bool path::has_root_name() const
      {
! #   if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
        return m_path.size() > 1
          && ( m_path[1] == ':' // "c:"
            || m_path[m_path.size()-1] == ':' // "prn:"
***************
*** 508,514 ****
      {
        return ( m_path.size() 
                 && m_path[0] == '/' )  // covers both "/" and "//share"
! #            ifdef BOOST_WINDOWS
                 || ( m_path.size() > 2
                      && m_path[1] == ':' && m_path[2] == '/' ) // "c:/"
  #            endif
--- 510,516 ----
      {
        return ( m_path.size() 
                 && m_path[0] == '/' )  // covers both "/" and "//share"
! #            if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
                 || ( m_path.size() > 2
                      && m_path[1] == ':' && m_path[2] == '/' ) // "c:/"
  #            endif
***************
*** 534,540 ****
          }
          if ( path_ptr->m_path[pos] == '/' )
          {
! #       ifdef BOOST_WINDOWS
            if ( name[name.size()-1] == ':' // drive or device
              || (name[0] == '/' && name[1] == '/') ) // share
            {
--- 536,542 ----
          }
          if ( path_ptr->m_path[pos] == '/' )
          {
! #       if defined(BOOST_WINDOWS) || defined(BOOST_NETWARE)
            if ( name[name.size()-1] == ':' // drive or device
              || (name[0] == '/' && name[1] == '/') ) // share
            {
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to