From: Michael Vrable Date: Thu, 24 May 2007 19:53:26 +0000 (-0700) Subject: Output filename to metadata log after fully processing file. X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=commitdiff_plain;h=ebe463a9bf1b092fb8a6d3d6b8ed7b5da12b2454 Output filename to metadata log after fully processing file. Previously, if there was an error processing the file, the metadata dictionary was not output, but the filename was, producing an incorrect metadata file. This is now fixed. --- diff --git a/scandir.cc b/scandir.cc index a82bc5e..9a590ba 100644 --- a/scandir.cc +++ b/scandir.cc @@ -221,8 +221,6 @@ void scanfile(const string& path) printf("%s\n", path.c_str()); - metadata << "name: " << uri_encode(path) << "\n"; - file_info["mode"] = encode_int(stat_buf.st_mode & 07777); file_info["mtime"] = encode_int(stat_buf.st_mtime); file_info["user"] = encode_int(stat_buf.st_uid); @@ -318,6 +316,7 @@ void scanfile(const string& path) file_info["type"] = string(1, inode_type); + metadata << "name: " << uri_encode(path) << "\n"; dict_output(metadata, file_info); metadata << "\n";