- // Open the source and destintation files
- FileFd From(Path,FileFd::ReadOnly);
- FileFd To(Itm->DestFile,FileFd::WriteEmpty);
+ // Open the source and destination files
+ FileFd From(Path,FileFd::ReadOnlyGzip);
+
+ // FIXME add an error message saying that empty files can't be valid archives
+ if(From.FileSize() == 0)
+ return false;
+
+ FileFd To(Itm->DestFile,FileFd::WriteAtomic);