Re: Paths with embedded spaces
- Posted by Chris Bensler <bensler at telus.net> Aug 16, 2001
- 398 views
Actually, you CAN quote a filename on DOS/WIN!! but not the file name and parameters together, which wouldn't make much sense anyways.. but that works for me. Thanks, yah helped an ya didn't even know it :) Solves your problem as well I did a test.. ex "test.ex" <-- works ex test.ex "this should be a sinlge parameter" <-- also works ex "test.ex" "this is a sinlge parameter" <-- sure thing ex test.ex "this is a single parameter which contains a \"" <-- no problem ex "test.ex this should be a sinlge parameter" <-- doesn't, file not found, which is entirely expected Rob, you might consider documenting that.. that's pretty useful to know. Chris ----- Original Message ----- From: <freeplay at mailandnews.com> To: "EUforum" <EUforum at topica.com> Sent: Thursday, August 16, 2001 2:15 AM Subject: RE: Paths with embedded spaces > > Hi Chris, > > The command_line() function for ex.exe and exw.exe just gives you command line > as typed at the command prompt. Nothing more and nothing less. If you have: > > exw prog.exw file name with spaces.mp3 > > you get the arguments: > > file > name > with > spaces.mp3 > > You might try: > > exw prog.exw "file name with spaces.mp3" > > but this gives you: > > "file > name > with > spaces.mp3" > > What you really want is a single argument of: > > file name with spaces.mp3 > > One way I can think of around this is to write a function, say > "quoted_command_line", which might be invoked like this: > > sequence cmd_line > > cmd_line = quoted_command_line(command_line()) > > The function would concatenate all the command line arguments and then split > them up again but this time with some special processing for handling the > quote (") character. You might want to build a way to have a quote (") > character allowed as part of an argument as in: > > exw prog.exw quote\"character > > and also with: > > exw prog.exw "this string has a quote \" in it" > > The Linux Euphoria doesn't have this problem because the UNIX shell does all > this for you before exu has even been called. For example this is perfectly > ok in Linux: > > exu prog.exu "this string has a quote \" in it" > > So a quoted_command_line type of function is one way to tackle this. If you > write one then I for one would appreciate a copy > > Regards, > > FP. > > >===== Original Message From Chris Bensler <bensler at telus.net> ===== > > > >How do I get around this? > >If I try to execute a file using ex/w.exe that contains spaces embedded in > >the path, EU thinks that the space is seperating the commandline parameters > >from the file name. > >It probably has something to do with long filenames, but I haven't a clue > >what to do about it. > > > >Chris > > > > > > > > >