How to shorten dynamically-generated directory names

113 views
Skip to first unread message

luckycharms

unread,
Sep 26, 2011, 2:15:30 PM9/26/11
to VisualWget Help
Hi Folks,

VisualWget is great! Thanks so much.

So, I'm using the following command (generated by VisualWget) to try
to download parts of a site. The problem is that wget is erroring out
when trying to write a ridiculously-long directory name (which is
dynamically generated by the site). Is there any way to shorten the
directory names without getting rid of them altogether?

the error:
Cannot write to `C:/Users/user/Desktop/folder/doi/10.1111/j.
1469-8137.2010.03390.x/full@url_ver=Z39.88-2004&rft_val_fmt=info%3Aofi
%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=the very
long and annoying journal title goes here&rft.atitle=Interactions blah
blah blah blah blah blah blah blah blah blah blah blah blah blah blah
&rft.volume=363&rft.spage=1779&rft.epage=1785&rft.date=2008&rft.aulast=laksjdf&rft.aufirst=LEOC&rfr_id=info
%3Asid%2Fbooley.com%3AOnlineLibrary.html' (No such file or directory).

the command:
@echo off
rem Wget executable must be either a) in PATH, or b) in the same
directory as this batch file.
wget --continue --convert-links --directory-prefix="C:\Users\USERNAME
\Desktop\DIRNAME" --html-extension --level="3" --no-host-directories --
no-parent --page-requisites --recursive --restrict-file-
names="windows" --timestamping "http://URLTODOWNLOAD"
pause

Khomsan Phongphisansakun

unread,
Sep 26, 2011, 11:11:30 PM9/26/11
to VisualWget Help
Hi,

The problem seem to be 255 characters file name limit on windows.
I can not find the way to shorten the file name itself.
Maybe you can use the Recursive Accept/Reject.
By rejecting this file name using pattern match and skip the file.

Best Regards,
Khomsan

luckycharms

unread,
Sep 27, 2011, 2:21:49 PM9/27/11
to VisualWget Help
Thanks Khomsan. Seems strange, right? I mean, wget is how old? You
would think that a bazillion people would have run up against this
problem by now. Rewriting long directory and file names would seem to
be an essential feature of a tool like wget. strange...

On Sep 26, 11:11 pm, Khomsan Phongphisansakun <khomsan...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages