Page 1 of 1
extracting files fles with long paths --> failed extraction
Posted: August 8th, 2011, 3:05 am
by Davor
Sometimes rar files, when extracted, contain very long paths. Sabnzbd will not extract these, abort the extraction and complain that there were missing files in the history tab:
"Unpacking failed, an expected file was not unpacked"
In the logs you find something like this:
Code: Select all
... ::INFO::[newsunpack:403] Extracting rarfile ....
... ::INFO::[newsunpack:635] Missing expected file: ...
... ::INFO::[newsunpack:200] Unrar finished on ...
Upon manual extraction with winrar I get an error that the paths are too long (+260 chars), so I assume this is the culprit.
Extracting it manually with a short path works.
Whether this is worth a bug I leave up to you.
Regards,
Davor
Re: extracting files fles with long paths --> failed extract
Posted: August 8th, 2011, 5:25 am
by shypike
Windows is hindered by poor support for long file names.
Solving that properly is very hard and not an investment I'm willing to make right now,
due to other priorities.
However, there is an (hidden) option to limit the size of individual path elements.
See here:
http://wiki.sabnzbd.org/configure-special item folder_max_length
A size of 64 is a safe bet.
Re: extracting files fles with long paths --> failed extract
Posted: August 8th, 2011, 5:43 am
by Davor
Thank you. Wasn't aware of those hidden options.
Re: extracting files fles with long paths --> failed extract
Posted: August 8th, 2011, 2:22 pm
by minimeh
I ran into the path length problem because I wanted to keep Sab's working folders out of the root of the hard drive. So by the time you prepend something like "C:\Documents and Settings\theuser\My Documents\sabnzbd", you've used up a pretty good chunk of the 260 characters normally allowed. While Windows does support a prefix, "\\?\", that permits an extended-length path for a maximum total path length of 32,767 characters (e.g. "\\?\C:\Documents and Settings\theuser\My Documents\sabnzbd"), supporting that is tricky at best. See
http://msdn.microsoft.com/en-us/library ... 85%29.aspx for Windows path name details.
The solution that I turned to was a junction point. A junction point allows the creation of a folder in one location that redirects to another folder in another location. So I created a folder "c:\sab" and pointed it to "C:\Documents and Settings\theuser\My Documents\sabnzbd", giving me 52 more characters to play with. Since doing that, I've had no issues.
There is a freeware utility called "Junction Link Magic" that makes managing junction points a snap. See
http://www.rekenwonder.com/linkmagic.htm. That page also goes into details on junction points.
Of course, you could just reconfigure SabNZBD to work with a regular folder "c:\sab" and move what you currently have to there. In my case, the only problem experienced was during extraction. I have a bunch of scripts and media players and so forth that are configured to look at the original folder. By using a junction point, I'm able to keep all happy with the least amount of rejiggering.
Re: extracting files fles with long paths --> failed extract
Posted: August 8th, 2011, 2:34 pm
by shypike
I know that Windows can handle long file names, only Microsoft made it very cumbersome.
Not all programming libraries support it properly and both par2 and unrar aren't so easily tamed.
As I said before, I know it's an issue, but I don't assign it a high priority right now.
Good that you found a working solution.
Re: extracting files fles with long paths --> failed extract
Posted: August 8th, 2011, 3:03 pm
by Davor
minimeh wrote:There is a freeware utility called "Junction Link Magic" [...]
Nice idea. Note that you can use junction or linkd (from win resource kit or support tools) or mklink in Win7. I prefer those above the 3d party utils.