From ebe463a9bf1b092fb8a6d3d6b8ed7b5da12b2454 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 24 May 2007 12:53:26 -0700 Subject: [PATCH] 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. --- scandir.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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"; -- 2.20.1