diff options
author | Richard Kreuter <richard@10gen.com> | 2010-12-09 15:15:24 -0500 |
---|---|---|
committer | Richard Kreuter <richard@10gen.com> | 2010-12-09 15:15:24 -0500 |
commit | c59538bc73772ab7c814050c610d94bffdaacd13 (patch) | |
tree | 4301c4b1bfbd07861f2550725b8565681a9f5d89 /tools | |
parent | 08be14dd9f122bea42ef52c143173461d9cc24f3 (diff) | |
download | mongo-c59538bc73772ab7c814050c610d94bffdaacd13.tar.gz |
Make the file being processed a member of Tool.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/tool.cpp | 8 | ||||
-rw-r--r-- | tools/tool.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tools/tool.cpp b/tools/tool.cpp index 1845a727e70..e460f600cef 100644 --- a/tools/tool.cpp +++ b/tools/tool.cpp @@ -358,19 +358,19 @@ namespace mongo { } long long BSONTool::processFile( const path& root ){ - string fileString = root.string(); + _fileName = root.string(); unsigned long long fileLength = file_size( root ); if ( fileLength == 0 ) { - out() << "file " << fileString << " empty, skipping" << endl; + out() << "file " << _fileName << " empty, skipping" << endl; return 0; } - FILE* file = fopen( fileString.c_str() , "rb" ); + FILE* file = fopen( _fileName.c_str() , "rb" ); if ( ! file ){ - log() << "error opening file: " << fileString << endl; + log() << "error opening file: " << _fileName << endl; return 0; } diff --git a/tools/tool.h b/tools/tool.h index d703c6b0fcb..746f09f37d6 100644 --- a/tools/tool.h +++ b/tools/tool.h @@ -101,6 +101,7 @@ namespace mongo { string _db; string _coll; + string _fileName; string _username; string _password; |