Community
Participate
Working Groups
Overview Description: Eclipse is able to create files with long paths (>256 symbols), but is unable to read them. Steps to Reproduce: To reproduce the problem create a new "Plug-in Project" using the "Hello World" template. In the "run" method body place the following code: <code> try { IWorkspace workspace = ResourcesPlugin.getWorkspace(); IProject project = workspace.getRoot().getProject("test"); project.create(null); project.open(null); IContainer parent = project; StringBuilder buf = new StringBuilder(50); for (int i = 0; i < 50; i++) { buf.append(i); } String folderName = buf.toString(); for (int i = 0; i < 5; i++) { IFolder folder = parent.getFolder(new Path(folderName)); folder.create(true, true, null); parent = folder; } IFile aFile = parent.getFile(new Path("test.txt")); aFile.create(new ByteArrayInputStream(new byte[0]), true, null); aFile = parent.getFile(new Path(folderName)); aFile.create(new ByteArrayInputStream(new byte[0]), true, null); } catch(Exception ex) { ex.printStackTrace(); } </code> Actual Results: After executing the action, all resources are visible as expected (and actually created on the file system), but when trying to access the file with the longer name, a message is shown saying "Resource /test does not exist.". After refreshing the project, most of the folders disappear. Expected Results: All resources are visible and available to work with through Eclipse. Build Date & Platform: 3.2.0 (M20060629-1905) on Windows XP Additional Information: As JSE 5 now supports directory structures where the total path exceeds 256 symbols it is expected that Eclipse supports these files too. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403166 for more details. Unfortunately it seems that Eclipse is using "the older" Windows API that doesn't support such files. The problem is reproducible with Eclipse 3.2.0 (M20060629-1905) and JSE 5 (java version "1.5.0_08" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03) Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode)). Best Regards, Tsvetan
There's a workaround at the Sun bug report that claims using UNC paths solves this problem: "To avoid this problem the native code should prepend \\?\ before any paths which are longer than 255 characters when passing file names to the Windows API. Actually you could always do this when the OS is NT." Alex.
*** This bug has been marked as a duplicate of 153375 ***