Re: IDE and files with spaces in path name
- Posted by Al Getz <xaxo at AOL.COM> Jan 11, 2001
- 443 views
Hello, i see you ran into some problems with executing programs from within programs. I have noticed that over the past few years the "system()" command had changed, as it used to always wait for the exe program that was called before executing the next Eu statement. After a few Eu "updates", that had changed, but you might try using the system() command with the second param set to 2 such as the code fragment below. Also, i think you found a bug in Euphoria's system_exec() command because as you had said, and i tryed it too here, the system() command works just fine, whereas the system_exec() command fails with the very same parameters. Have to write to RDS about that. Perhaps there is an easy workaround. As for now, i use system() and providing a 2 for the second param provides for needed synchronicity (You might wish to read up on that too though). As a last resort, creating a dynamic .bat file works also. If you wish to get the short path as a solution, ive included the C code below too. atom ret,ink include get.e sequence ExwCommand ExwCommand=34&"exw.exe"&34&" "& 34&"c:\\america online 5.0\\download\\test.exw"&34 ret=system_exec(ExwCommand,2) --doesnt work! ?ret system(ExwCommand,2) --works fine!! ink=wait_key() ------------- --start c code: -- win95+ The "GetShortPathName()" function obtains the short path form of a specified input path. (in kernel32.dll) DWORD GetShortPathName( LPCTSTR lpszLongPath, // points to a null-terminated path string LPTSTR lpszShortPath, // points to a buffer to receive the null- terminated short form of the path DWORD cchBuffer // specifies the size of the buffer pointed to by lpszShortPath ); lpszLongPath: Points to a null-terminated path string. The function obtains the short form of this path. lpszShortPath: Points to a buffer to receive the null-terminated short form of the path specified by lpszLongPath. You can set lpszShortPath to the same value as lpszLongPath. cchBuffer: Specifies the size, in characters, of the buffer pointed to by lpszShortPath. Return Value: If the function succeeds, the return value is the length, in characters, of the string stored in *lpszShortPath, not including the terminating null character. If the function fails due to *lpszShortPath being too small to contain the short path string, the return value is the size, in characters, of the short path string. You need to call the function with a short path buffer that is at least as large as the short path string. If the function fails for any other reason, the return value is zero. To get extended error information, call GetLastError. -- ------------- good luck with it, Al