19 #ifndef ROSTLAB_CWD_RESOURCE
20 #define ROSTLAB_CWD_RESOURCE
50 if( ( buf = getcwd( NULL, 0 ) ) == NULL )
throw runtime_error(
string(
"failed to get working directory: ") + strerror( errno ) );
51 string cwd = buf; free( buf ); buf = NULL;
53 if( chdir( __dirname.c_str() ) )
throw runtime_error(
"failed to chdir to '" + __dirname +
"': " + strerror( errno ) );
61 if( chdir( _olddir.c_str() ) )
throw runtime_error(
"failed to chdir to '" + _olddir +
"': " + strerror( errno ) );
74 #endif // ROSTLAB_CWD_RESOURCE
void acquire(const string &__dirname)
cwd_resource(const string &__dirname)