HTTrack Website Copier
Free software offline browser - FORUM
Subject: Userdef structure too long
Author: Emerson
Date: 03/13/2011 12:04
For php sites that make heavy use of url parameters, I've found that the user
defined structure functionality of httrack  is extremely useful for saving
files with much more descriptive (and in that sense useful) names. To give an
example, phpBB boards use the parameters f= (for forum number), t= (for thread
id), id= (for file id), etc, etc.

I tried to create a userdef string that included all these parameters of the
form "[f:f=:::][t:-t=:::][id:-id=:::][mode:-mode=:::]" ... and so on.

Any given url, only has 1-3 of these parameters, but the way the userdef
structure is implemented, I have to have a mega-userdef string that includes
any possible parameter for any possible url that I want httrack to keep in the

When I tried this, I ran into the error "Userdef structure string too long".

I was over the limit by ~10 chars and much of that was because of the required
syntax of the userdef structure. I searched the forums and found what seems to
be the relevant part of the code: 

if (strlen(argv[na])>=127) {
  HTS_PANIC_PRINTF("Userdef structure string too long");
  return -1;

My best guess is that this limitation is in place to prevent "filename too
long" issues on windows machines (which is a RIDICULOUS and annoying part of
windows, but I digress).

That said, while I can understand trying to protect users from this
limitation, it would be great if httrack presented this as a warning that
could be could be clicked thru, and not as a hard limit. The reason I say this
is because as with my example, url's are not actually going to be 127+ chars
long, they will actually be more like 10-15 chars. The userdef structure is so
long because of trying to include all of the relevant parameters that might

This is mostly a wishlist item for Xavier, and also was hoping to hear back
about the reasoning behind this limit. I don't really know C, but I could
learn enough to cook up a patch. I just wanted to hopefull hear back on why
this limit existed incase I might be breaking something somewhere else in
trying to raise this limit or replace it with a click thru warning.

Thanks :)

All articles

Subject Author Date
Userdef structure too long

03/13/2011 12:04


Created with FORUM 2.0.11