handle weird boost case with weird filenames

This commit is contained in:
Eliot Horowitz
2009-10-07 12:43:44 -04:00
parent 498169e9e3
commit fecc9119a7

View File

@@ -78,12 +78,18 @@ namespace mongo {
int num =0;
while ( i != end ){
path p = *i;
BSONObjBuilder b;
b << "name" << p.string();
b.appendBool( "isDirectory", is_directory( p ) );
if ( ! is_directory( p ) )
b.append( "size" , (double)file_size( p ) );
if ( ! is_directory( p ) ){
try {
b.append( "size" , (double)file_size( p ) );
}
catch ( ... ){
i++;
continue;
}
}
stringstream ss;
ss << num;