Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 122540 - Some source file paths too long
Some source file paths too long
Product: www
Classification: Unclassified
Component: Builds & Repositories
All All
: P1 (vote)
: 6.x
Assigned To: Jesse Glick
Depends on: 122541 122542 122543 122544 122545 122546 122547 122548 122549
  Show dependency treegraph
Reported: 2007-11-21 19:57 UTC by Jesse Glick
Modified: 2014-01-24 08:27 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-11-21 19:57:49 UTC
Windows imposes a 260-character limit on full file paths including drive and final NUL. Many files in CVS are
already approaching that; for example, the worst is


at 209, leaving only 50 characters for e.g.


above which CVS commands will fail.

The Mercurial import triggers some problems here, as Mercurial storage paths expand a bit when there are capital letters
or underscores in the original:

and the result can make it impossible to unpack a Hg repo on Windows, e.g.

$ tar -xvf main.tar
Nelze open: File name too long

I have collected a list of files in CVS which produce repository paths even longer than the longest paths we used
in CVS and which are therefore immediate problems. (There are thousands more files which are longer than they perhaps
should be but which are not likely to pose problems to people already using CVS successfully.)

These issues need to resolved quickly; otherwise it is difficult to test Hg operations on Windows. With the current
state, the longest root prefix you can use is likely to be e.g.


which is pretty limiting.
Comment 1 Jesse Glick 2007-11-21 20:11:17 UTC
For reference, found using command:

find */.hg | ruby -n -e 'BEGIN {@trans={}; open("main/nbbuild/translations").each_line {|l| parts=l.chomp.split "//";
@trans[parts[1]] = parts[0]}}; if (!/^.{0,209}$/) then gsub!(/_([a-z_])/) {|c| $1.upcase};
gsub!(%r{^([a-z]+/)\.hg/store/data/(.+)/([^/]+)\.i$}) {|all| repo=$1; path=$2; file=$3; puts "#{@trans[repo +
path]}/#{file}"}; end' | sort
Comment 2 Jesse Glick 2007-11-21 20:32:44 UTC
There is no exact maximum for CVS file lengths - problems will depend on the path length used for the root of a
checkout, and the chars added by Hg will depend on the number of [A-Z_] in the path - but for the files that I filed
bugs for it would be good to trim off at least 30-40 characters. In most cases the long files are tests whose names can
simply be abbreviated, e.g.


could just as easily be named something like


saving 41 characters.
Comment 3 Jesse Glick 2008-01-21 22:28:57 UTC
All fixed with the exception of 9 files in enterprise/openesbaddons/contrib-imola in CVS, which anyway go to the misc repo.

Also have fixed import script to just skip over any files with paths too long (above 206 chars in store path) and
produce a report about them. So good enough for now.
Comment 4 sam63 2014-01-24 08:27:09 UTC
Long Path Tool can be the best solution, I will say.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo