IDE and files with spaces in path name/Judith/Wolf/RDS
- Posted by Al Getz <xaxo at AOL.COM> Jan 15, 2001
- 408 views
IDE and files with spaces in path name: Judith originally wrote: >I've got a long standing problem with IDE. I'm putting quotes around the >file name so that the statement looks like this: > system_exec exw "c:\path\my files\myprog.exw" >but what Eu sees is c:\path\my.exw. Does anyone know what I need to do? I >can run from Start\Run button so I know EU can process it. Is system_exec >the problem? >Thanks, >Judith Wolf wrote: >>how about using current_dir() and chdir(), in your program segment ? >>example: >>sequence current_path,odd_path >>current_path=current_dir() >>odd_path="C:\\ab cd\\" >>atom go,there,now >>-- without error checking >>go=chdir(odd_path) >>there=system_exec("exw yourprogram.exw",0) >>now=chdir(current_path) >>---- now check for ex.err Judith wrote back: >>>Thanks, Wolf >>>Works like a champ! I hate to say this but: Its ok if your filename will NEVER contain spaces, but i usually consider it bad programming practice to use a lazy workaround when another much more general solution lies just around the corner that will work on *any* valid argument, and even though it works fine with paths that contain spaces in the *directory name* only, unfortunately thats either a temporary solution or a very specific file name solution, as the same problem will occur with file names that contain spaces themselves, such as: there=system_exec("exw c:\\dir1\\file name containing spaces.exw",0) that's why i suggested the more general solution with a C code wrapper in an earlier post using "GetShortPath(...)" as a workaround. Its a simple function to wrap. Any system that queries the user to enter a filename needs this support. Of course if you dont need return info, "system()" works fine as is. BTW, its not possible to predict the short path with the program itself, the only way is to "ask" the file system (Windows). Strange thing is, 'system("exw "&path&filename,2)' works either way. Someone please write RDS about this? Thanks. --have a nice day! --Al