Summary: | Problems Copying files with $ in name | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Kevin Doyle <kjdoyle> | ||||||
Component: | RSE | Assignee: | Martin Oberhuber <mober.at+eclipse> | ||||||
Status: | CLOSED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | dmcknigh, mober.at+eclipse, rgerganov | ||||||
Version: | 2.0 | Keywords: | bugday | ||||||
Target Milestone: | 3.0 M5 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Kevin Doyle
2007-05-22 10:58:05 EDT
I'll look at this. $ is considered a special char by the LocalFileService which is not correct on a Windows platform. Moreover, reserved shell charactes should be escaped with ^ instead of \ on Windows. This is what MSDN says: "all reserved shell characters not in double quotes must be escaped. These characters have special meaning to the Windows NT command shell. The reserved shell characters are: & | ( ) < > ^ To pass reserved shell characters as part of an argument for a command, either the entire argument must be enclosed in double quotes, or the reserved character must be escaped." Both source and target arguments are enclosed with double quotes in LocalFileService#copy(), so there is no need to escape them if we are running on Windows. I will propose a patch. Created attachment 89357 [details]
there is no need to escape special chars on Windows if the arguments are enclosed with double quotes
Created attachment 89388 [details]
A better patch (in line with dstore CopyThread)
Thanks for finding the problem, it helped me come up with a different patch.
Since we're using the same functionality for the dstore-Windows server I checked what we're doing there (find it in
org.eclipse.rse.services.dstore
/miners/
org.eclipse.rse.internal.dstore.universal.miners.filesystem/
CopyThread.java
there, we are using an enQuote() method taking care of the windows/unix differences, and using PathUtility.enQuoteUnix() for the UNIX enquoting.
Using that code, I was able to accomplish the same but getting rid of a quite a bit of unnecessary code.
Patch tested and committed. Verified fixed in I20080213-1800. *** Bug 168220 has been marked as a duplicate of this bug. *** |