| > 18:23:23 Error: "Open error when decompressing"
> (-1) at link www.appletree.com/people/q (from
> primary/primary)
Ah, darn! This was a longstanding bug I probably managed to reproduce (and
fix). The issue is related to the way httrack uncompress content, using
temporary files on disk. On some situation (when the working directory is a
non-writable directory), the filenames produced by the system are not correct,
and httrack is unable to do any extracting.
This also explain why some users have sometimes files in "C:" (or in other
working directories) ; see the "alien files in C:" thread. I could never
understand what was going on -- this time the issue should be definitely fixed
(I hope)
Can you try again with the 3.43-7 and see is the problem has disappeared
please ?
Thanks for the report, BTW :)
(For the technical details, this is related to tmpnam() use - which creates
filenames relative to the current working directory. tempnam() does the same,
but with absolute path leading directly to the system-generated user's
temporary directory)
Complete diff from the -6 release:
----------------------------------
--- httrack-3.43.6/src/htsback.c 2009-07-18 17:50:42.000000000 +0200
+++ httrack-3.43.7/src/htsback.c 2009-07-23 19:14:13.000000000 +0200
@@ -479,8 +479,23 @@
back[p].compressed_size=back[p].r.size;
// en mémoire -> passage sur
disque
if (!back[p].r.is_write) {
+#if 1
+#ifdef _WIN32
+#undef tempnam
+#define tempnam _tempnam
+#endif
+ char *const tmp = tempnam(NULL, "httrack_temporaryGzipFile_");
+ if (tmp != NULL) {
+
strcpybuff(back[p].tmpfile_buffer, tmp);
+ free(tmp);
+ back[p].tmpfile = back[p].tmpfile_buffer;
+ } else {
+ back[p].tmpfile = NULL;
+ }
+#else
back[p].tmpfile_buffer[0]='\0';
back[p].tmpfile=tmpnam(back[p].tmpfile_buffer);
+#endif
if (back[p].tmpfile !=
NULL && back[p].tmpfile[0] != '\0') {
back[p].r.out=fopen(back[p].tmpfile,"wb");
if
(back[p].r.out) {
@@ -497,7 +512,7 @@
} else {
back[p].tmpfile[0]='\0';
back[p].r.statuscode=STATUSCODE_INVALID;
-
strcpybuff(back[p].r.msg,"Open error when decompressing");
+
strcpybuff(back[p].r.msg,"Open error when decompressing (can not create a
temporary file)");
}
}
}
@@ -2719,8 +2734,23 @@
/* .gz are *NOT* depacked!! */
(strfield(get_ext(catbuff,back[i].url_sav),"gz") == 0)
) {
+#if 1
+#ifdef _WIN32
+#undef tempnam
+#define tempnam _tempnam
+#endif
+ char *const tmp = tempnam(NULL,
"httrack_temporaryGzipFile_");
+ if (tmp != NULL) {
+ strcpybuff(back[i].tmpfile_buffer, tmp);
+ free(tmp);
+ back[i].tmpfile = back[i].tmpfile_buffer;
+ } else {
+ back[i].tmpfile = NULL;
+ }
+#else
back[i].tmpfile_buffer[0]='\0';
-
back[i].tmpfile=tmpnam(back[i].tmpfile_buffer);
+
back[i].tmpfile=tmpnam(back[p].tmpfile_buffer);
+#endif
if (back[i].tmpfile != NULL &&
back[i].tmpfile[0]) {
if
((back[i].r.out=fopen(back[i].tmpfile,"wb")) == NULL) {
last_errno = errno;
| |