Community
Participate
Working Groups
Build Identifier: I20100608-0911 When a project is exported, with all files and folders selected, and the radio button 'create only selected directories' selected, the exported zip file cannot be read by Windows Explorer - it is shown as empty. WinZip can read the file (it appears the same as the archive created when the option 'create directory structure for files' is selected. WinRAR shows the file the same except that the project name has a leading backslash, e.g. '\project'. When exporting the This may be a Windows bug, as WinZip and WinRAR (and apparently 7Zip) are able to read the file with the contents show correctly, and can export the file. However, the leading backslash in WinRAR may indicate the problem. Perhaps this is invalid? Whether valid or not, perhaps this is what Windows Explorer cannot handle. I don't know. But, if only a subfolder within the file is selected and the option 'create directory structure for files' is selected, then the resulting zip file can be read by Windows Explorer and WinRAR does not show a leading backslash on the name of the root folder (which will of course be different in this case). I do not see why the resulting zip file should be different based on which radio button is selected 'create directory structure for files'/'create only selected directories' if ALL files within the project are selected Reproducible: Always Steps to Reproduce: 1. Create a project with a folder and a file, e.g. /project/folder/file.txt 2. Export the project as an archive file, with the option 'create only selected directories' selected. 3. Try to open the exporting archive file with Windows Explorer. It will be shown as empty. 4. Export the project as an archive file again, to a different file name, this time with 'create directory structure for files' selected. 5. Open this file in Windows Explorer, the contents will be shown correctly. 6. Open both archive files in WinRAR. Note the leading backslash in the archive file created where 'create only selected directories' was selected.
That's bad. Broken since at least 3.5.2.
The problem still exists in Eclipse 4.4! I just fell into the trap reporting another eclipse-problem. It looks like "Create only selected directories" has a problem if the top level folder is a (java-)project. The the resulting zip looks like that (x.zip is the exported project): x.zip: + - "" + project-filder + rest of the project files and folders That is, there is a top-level-folder named "" (empty name, not quotes) and _under_ that empty-named-folder the project is in the archive. I could not extract the contents with Windows means. 7-zip is able to handle that. With that you also see that there is a empty-named top-level-folder. I'll attach to zip's: XECERR_DEL_SRCFLDR.zip XECERR_DEL_SRCFLDR_2.zip The first is ok (selected "Create directory structure for files"), the second is the problematic one (selected "Create only selected directories"). For both "Save in zip format" and "Compress the..." were selected. The selection for export to archive was the project itself.
Created attachment 245633 [details] exported project - correct zip see my last comment
Created attachment 245634 [details] exported project - incorrect zip see my last comment
The Zip file format spec is clear: 4.4.17 file name: (Variable) 4.4.17.1 The name of the file, with optional relative path. The path stored MUST not contain a drive or device letter, or a leading slash. org.eclipse.ui.internal.wizards.datatransfer.ArchiveFileExportOperation#createDestinationName(int, IResource) fell into the trap of bug 451335 and created Zips with invalid path names that start with a '/'. Fixed with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b3156d784a5bb5aee8131a604f2324168b7da8b7