[Insight-users] 50 character limit in ITK on Win32?

Cory Quammen cquammen at cs.unc.edu
Thu May 3 17:24:18 EDT 2012


Mark,

I think the path length choice was made conservatively because no one
had the patience to figure out the exact length where things go wrong.

The depth of the source tree, especially with the third-party
libraries, is more of a problem that are the file name lengths in ITK.

It might be more reasonable to issue a warning rather than halt with
an error. You may want to propose this to the developers list to see
what others think.

- Cory

On Thu, May 3, 2012 at 5:13 PM, Mark Roden <mmroden at gmail.com> wrote:
> But a path length of 66 works.
>
> It appears that this patch was for a particular compiler (vs2010) and
> a particular version of cmake (2.8.3).  That's a much more specific
> issue than all win32 platforms; I'm on vs2008, and as I said, 66
> characters works just fine.
>
> And I would be strongly in favor of making this a warning, rather than
> hard limit, if it's difficult/impossible to detect that particular
> combination of compiler/cmake versions.  I don't, and never have had,
> an issue building in ITK in any random directory, regardless of path
> length-- maybe because I tend to keep my path lengths lower than 100
> characters.
>
> But if this does continue to be an issue, is there some kind of style
> guide for path length?  I see some really absurdly long filenames in
> there, and if it really is an issue with vs2010, then maybe that style
> should be enforced (along with all of the other commit rules).
>
> On Thu, May 3, 2012 at 2:04 PM, Cory Quammen <cquammen at cs.unc.edu> wrote:
>> Mark,
>>
>> The limit is there to save your sanity :-)
>>
>> Did you try to compile with a path length of 100 characters? When I
>> did, I ran into a file-not-found complaint by the compiler when
>> compiling GDCM. Then I checked to see that the file it is complaining
>> about does indeed exist.
>>
>> See the long email thread that led to this restriction here:
>>
>> http://www.itk.org/pipermail/insight-developers/2011-June/019268.html
>>
>> Basically, the relative paths generated by CMake and limitations in
>> the length of paths in Visual Studio lead to this limit.
>>
>> Cory
>>
>> On Thu, May 3, 2012 at 4:49 PM, Mark Roden <mmroden at gmail.com> wrote:
>>> Hi all,
>>>
>>> I've just recompiled itk 4.0, and found that there's a 50 character
>>> path limit for win32.
>>>
>>> What's the logic behind this?  I comment out that line, and everything
>>> works perfectly fine.
>>>
>>> The filename limit for windows is 255 (260 including the drive letter
>>> and trailing null), but each component of the path can be 255
>>> characters long.  MacOS has the same limit for HFS+, where each
>>> element is locked to 255, but the total path has to be 1024 or lower.
>>> (source: http://en.wikipedia.org/wiki/Comparison_of_file_systems).  If
>>> you're not using windows-specific programming, but just treating the
>>> path as a string, there's a 255 character limit.
>>>
>>> With my base file path that's 66 characters long, the longest filename
>>> I can find is 146:
>>>
>>> C:\Users\mmroden\Documents\src\MyProjectsinQT\ExternalLibs\itk\ITK\Documentation\Migration\ConstNeighborhoodIteratorGetBoundaryConditionChange.xml
>>>
>>> That's a far cry from 255.
>>>
>>> Just how deep are the paths in ITK anyway?  Is the directory tree
>>> really 205 characters long?  Or is this just someone guessing without
>>> actually checking?
>>>
>>> The problem with this is that I want to incorporate ITK building as
>>> part of a build script, rather than having to checkin binary images
>>> into a repo.  I'd have to add a portion to the script to remove the
>>> limit.
>>>
>>> What if it were just set to 100?
>>>
>>> Thanks,
>>> Mark
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>>
>> --
>> Cory Quammen
>> Research Associate
>> Department of Computer Science
>> The University of North Carolina at Chapel Hill



-- 
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill


More information about the Insight-users mailing list