Hello Sui, You are right. If you use quotes, it will take the quotes as a part of the name and again you will have the error message.
Before you call the openfile.pl, first put a check if your file contains a space and if it does, then put %20 which later will be translated as a space. I hope it will resolve the issue. Regards, /s -----Original Message----- From: Sui Ming Louie [mailto:[EMAIL PROTECTED] Sent: 16 January 2004 21:30 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: spaces in filenames to open If you enclose the filename in quotes (e.g. "a b.doc"), the filename including the space(s) will be part of the argument list to the program (openfile.pl in your example). [perl] openfile.pl "a b.doc" ... Sui -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:37 AM To: [EMAIL PROTECTED] Subject: spaces in filenames to open Hi, i have written a little tool that opens a file based on it's extension. I use Win32::FileOp's "ShellExecute" function for this. My tool is called from a java application. Now when my tool is called with a filename with spaces within like "openfile.pl a b.doc" (where openfile.pl is the tool), obviously it fails. The question now is, where to fix this. From my view, *my* only possibility would be to take all commandline args that I get and combine them as string again. But I never know how much spaces there are, and it sure doesn't look elegant ;). My guess would be, that the java-programmers should call my programm with spaces around the filename. Any other ideas? Lars _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ______________________________________________________________ This message has been scanned for all viruses by BTnet VirusScreen. The service is delivered in partnership with MessageLabs. This service does not scan any password protected or encrypted attachments. If you are interested in finding out more about the service, please visit our website at http://www.btignite.com/internetservices/btnet/products_virusscreen.htm ============================================================== _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
