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

Cory Quammen cquammen at cs.unc.edu
Thu May 3 17:04:34 EDT 2012


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


More information about the Insight-users mailing list