1. IDE and files with spaces in path name

Hi,

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

new topic     » topic index » view message » categorize

2. Re: IDE and files with spaces in path name

.. don't know about DOS_stuff... but how about this,
include win32lib.ew
constant
MyWin=create(Window,"opens",0,10,10,200,40,0)
procedure go()
-- space between AB, and CD !
shellExecute("open","c:\\AB CD\\yourprogram.exw",SW_SHOWNORMAL)
end procedure
onOpen[MyWin]=routine_id("go")
WinMain(MyWin,Normal)

>          system_exec exw "c:\path\my files\myprog.exw"
Wolf

new topic     » goto parent     » topic index » view message » categorize

3. Re: IDE and files with spaces in path name

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: IDE and files with spaces in path name

.. 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  blink
go=chdir(odd_path)
there=system_exec("exw yourprogram.exw",0)
now=chdir(current_path)
---- now check for ex.err
..if I understand your 'flow', this worked OK for me

Wolf

new topic     » goto parent     » topic index » view message » categorize

5. Re: IDE and files with spaces in path name

But doesn't the statement after the shellExecute immediately execute before
the running program has completed?

After I run the program with system_exec I look to see if ex.err exists and
then show the error statement in the IDD's Code Editor.

I tried using system instead of system_exec and it worked fine with the
spaces but it let the error checking happen (which is the next set of
statements after the system.....) before it ended so it always thought there
was no ex.err file when in fact there might have been.

Judith



On Thu, 11 Jan 2001 11:59:59 -0500, wolfgang fritz <wolfritz at KING.IGS.NET>
wrote:

>... don't know about DOS_stuff... but how about this,
>include win32lib.ew
>constant
>MyWin=create(Window,"opens",0,10,10,200,40,0)
>procedure go()
>-- space between AB, and CD !
>shellExecute("open","c:\\AB CD\\yourprogram.exw",SW_SHOWNORMAL)
>end procedure
>onOpen[MyWin]=routine_id("go")
>WinMain(MyWin,Normal)
>
>>          system_exec exw "c:\path\my files\myprog.exw"
>Wolf

new topic     » goto parent     » topic index » view message » categorize

6. Re: IDE and files with spaces in path name

Thanks, Wolf

Works like a champ!

Judith

On Thu, 11 Jan 2001 19:58:51 -0500, wolfgang fritz <wolfritz at KING.IGS.NET>
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  blink
>go=chdir(odd_path)
>there=system_exec("exw yourprogram.exw",0)
>now=chdir(current_path)
>---- now check for ex.err
>...if I understand your 'flow', this worked OK for me
>
>Wolf

new topic     » goto parent     » topic index » view message » categorize

7. Re: IDE and files with spaces in path name

Hi Judith,

I'm sure my answer isn't the best .. and maybe not even correct,
but I think I remember seeing somewhere Win32 API routines
for converting file paths from the long format to short (8.3) format.

I don't know if anyone has wrapped these in Euphoria yet,
but I imagine it would overcome the problem.

Ray Smith


----- Original Message -----
From: Judith Evans <camping at FLASH.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, January 11, 2001 10:03 PM
Subject: IDE and files with spaces in path name


> Hi,
>
> 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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu