Skip to content
Browse files

db-push-dir: only push new files

  • Loading branch information...
1 parent c09be41 commit 5163652b425d62febfb4b5ab065842fffed03690 @albertz committed Mar 7, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 db-push-dir.cpp
View
5 db-push-dir.cpp
@@ -28,6 +28,11 @@ Return _main(const std::string& dirname) {
if(dir.filename.substr(dir.filename.size()-4) != ".png") continue;
std::string filename = dirname + "/" + dir.filename;
+ DbEntryId ref;
+ if(db.getFileRef(ref, "/" + baseFilename(filename)))
+ // skip files we already have in DB
+ continue;
+
FILE* f = fopen(filename.c_str(), "rb");
if(f == NULL) {
cerr << "error: " << dir.filename << ": cannot open file" << endl;

0 comments on commit 5163652

Please sign in to comment.
Something went wrong with that request. Please try again.