- // Open the source and destintation files
- FileFd From(Get.Path,FileFd::ReadOnly);
- FileFd To(DestFile,FileFd::WriteEmpty);
+ URI Get = Itm->Uri;
+ std::string Path = Get.Host + Get.Path; // To account for relative paths
+
+ FetchResult Res;
+ Res.Filename = Itm->DestFile;
+ URIStart(Res);
+
+ // Open the source and destination files
+ FileFd From(Path,FileFd::ReadOnly, FileFd::Gzip);
+
+ if(From.FileSize() == 0)
+ return _error->Error(_("Empty files can't be valid archives"));
+
+ FileFd To(Itm->DestFile,FileFd::WriteAtomic);