Community
Participate
Working Groups
If you try and copy and paste a file/folder from a path that contains a space then the copy will fail. The reason for this is that the xcopy command has the source directory with double quotes x2 around it. Example Command it tries to do: xcopy ""C:\Documents and Settings\webfacing\Desktop\source"" "C:\Documents a nd Settings\webfacing\Desktop\patches\source" /S /E /K /Q /H /I /Y If you try to type this in normally you get the error: Invalid number of parameters. Steps to Reproduce: 1. Connect to a DStore Windows server. 2. Expand your My Home Filter. 3. Copy and Paste some file/folder from your My Home filter to another folder. --> Error dialog appears saying Copy has failed. -----------Enter bugs above this line----------- TM 2.0 Testing installation : eclipse-SDK-3.3 RSE install : RSE 2.0 java.runtime : Sun 1.5.0_11-b03 os.name: : Windows XP, Service Pack 2 ------------------------------------------------
Do you think you can come up with a patch? - Ideally, we should have some general utils for quoting.
Martin, since I've looked into a similar issue before, you could assign this bug to me. And also (it is very strange) we could not debug the DStore server code in Kevin's machine. The Java Remote Debugger just could not attach to the running DStore server, and we ended up adding quite a few of println statements in the DStore code. Not sure if this has anything to do with using 1.6 of JRE? Did anyone encounter this debugging issue before?
Xuan I can take this one. After taking a look at the source I see the problem. We are making a src = enquote(src) call twice. Unix and Windows both need it so it's done outside the if(_isWindows) and then done again inside the if(_isWindows). For general quoting utilities in the code it calls enquote which is this: protected String enQuote(String s) { if(_isWindows) { return '"' + s + '"'; } else { return PathUtility.enQuoteUnix(s); } } We are already using org.eclipse.rse.services.clientserver.PathUtility to handle quoting for unix. We could add an enQuoteWindows(s) that will put quotes around a string that isn't already quoted and also add an enQuote(s, boolean isWindows) that would just call the proper enQuoteWindows(Unix) function. Since org.eclipse.rse.services.clientserver isn't internal should we open up a new bug enhancement for this for 3.0?
Created attachment 73284 [details] Only enQuote the source string once Legal Message: I, Kevin Doyle, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this contribution under the EPL.
Created attachment 73360 [details] Updated for latest changes to UniversalFileSystemMiner
I've committed the fix to cvs.
Adding contributed kwd
(In reply to comment #3) Thanks for the fix, it is good. Regarding the other issues brought up: > We are already using org.eclipse.rse.services.clientserver.PathUtility to > handle quoting for unix. We could add an enQuoteWindows(s) that will put > quotes around a string that isn't already quoted and also add an enQuote(s, > boolean isWindows) that would just call the proper enQuoteWindows(Unix) > function. I do not want to promote quoting on windows too much since it doesn't really work too well. I think a better approach would be to avoid any shell command execution as well as any quoting, and have all the work done directly from Java. Also, quoting on Windows is simple enough and functionality like "add quotes if they are not already there" just fosters programming errors (there should really be a prerequisite that quotes must be there or cannot be there). Therefore, I'm against additional enQuoteWindows() API.
Verified with I20070713-0605.