Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 165130 - Incomplete long filenames support under Windows
Summary: Incomplete long filenames support under Windows
Status: RESOLVED DUPLICATE of bug 153375
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-20 03:20 EST by Tsvetan Stoyanov CLA
Modified: 2006-11-20 13:09 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tsvetan Stoyanov CLA 2006-11-20 03:20:35 EST
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
Comment 1 Alex Blewitt CLA 2006-11-20 07:01:26 EST
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.
Comment 2 John Arthorne CLA 2006-11-20 13:09:13 EST

*** This bug has been marked as a duplicate of 153375 ***