1. Run an application in a directory named with spaces

Hello

A long time ago I posted here asking how to use this line in a Euphoria program

void = system_exec("C:\\Program Files\\testWe.exe", 2) 

and to the present day, still can not solve the problem. Does anyone have a solution today?

Thanks in Advance

new topic     » topic index » view message » categorize

2. Re: Run an application in a directory named with spaces

sergelli said...

Hello

A long time ago I posted here asking how to use this line in a Euphoria program

void = system_exec("C:\\Program Files\\testWe.exe", 2) 

and to the present day, still can not solve the problem. Does anyone have a solution today?

use 8.3 name?

void = system_exec("C:\\PROGRA~1\\testWe.exe", 2) 
new topic     » goto parent     » topic index » view message » categorize

3. Re: Run an application in a directory named with spaces

sergelli said...

Hello

A long time ago I posted here asking how to use this line in a Euphoria program

void = system_exec("C:\\Program Files\\testWe.exe", 2) 

and to the present day, still can not solve the problem. Does anyone have a solution today?

Thanks in Advance

Have you tried escaping the quotes?

void = system_exec("\"C:\\Program Files\\testWe.exe\"", 2) 
new topic     » goto parent     » topic index » view message » categorize

4. Re: Run an application in a directory named with spaces

euphoric said...

Have you tried escaping the quotes?

void = system_exec("\"C:\\Program Files\\testWe.exe\"", 2) 

Ok, so it works. Now the real problem and more difficult. Consider that "euwc" is in my path

void = system_exec("exwc \"C:\\Program Files\\testWe.EXW\"", 2) 

How to make this line work?

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

5. Re: Run an application in a directory named with spaces

sergelli said...

Ok, so it works. Now the real problem and more difficult. Consider that "euwc" is in my path

void = system_exec("exwc \"C:\\Program Files\\testWe.EXW\"", 2) 

How to make this line work?

Works just fine here... Then again I am using Phix's system_exec...
Ahh, it does not work on exwc (2.4), and neither on eui 4.0 nor eui 4.1
Now that is rather odd.

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

6. Re: Run an application in a directory named with spaces

petelomax said...
sergelli said...

Ok, so it works. Now the real problem and more difficult. Consider that "euwc" is in my path

void = system_exec("exwc \"C:\\Program Files\\testWe.EXW\"", 2) 

How to make this line work?

Works just fine here... Then again I am using Phix's system_exec...
Ahh, it does not work on exwc (2.4), and neither on eui 4.0 nor eui 4.1
Now that is rather odd.

I do not understand .... I tested with Eu3.11 and new versions 4. I've used this code in many operating systems from XP to Windows 10 and also with Linux under Wine
It never worked
In this last time I tested now in Windows 7, and nothing.
Certainly more people with this problem.
What is Phix's system_exec... ????
Please advise what is the secret.

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

7. Re: Run an application in a directory named with spaces

sergelli said...

What is Phix's system_exec... ????
Please advise what is the secret.

Phix is my version of OpenEuphoria, see http://phix.is-great.org/

But you may not have to replace OpenEuphoria: if you go to https://bitbucket.org/petelomax/phix/src and download builtins/syswait.ew - but (important) click on the revision dropdown (top left, just before the words "Full commit") and select the oldest version (2015-08-27 init) that should still be OE compatible, but I haven't tested it for a while.

HTH, Pete

Edit: the latest version of syswait.ew has some Phix-specific Linux code in it that is not OE-friendly, which you'd have to delete, which is why I suggest getting the older version.

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

8. Re: Run an application in a directory named with spaces

petelomax said...

Phix is my version of OpenEuphoria, see http://phix.is-great.org/

But you may not have to replace OpenEuphoria: if you go to https://bitbucket.org/petelomax/phix/src and download builtins/syswait.ew - but (important) click on the revision dropdown (top left, just before the words "Full commit") and select the oldest version (2015-08-27 init) that should still be OE compatible, but I haven't tested it for a while.

HTH, Pete

Edit: the latest version of syswait.ew has some Phix-specific Linux code in it that is not OE-friendly, which you'd have to delete, which is why I suggest getting the older version.

Phix looks good but I have doubts, however I can not I register on Phix forum because the site does not send me e-mail confirmation and there is no way to sent messages to the site administrators

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

9. Re: Run an application in a directory named with spaces

sergelli said...
euphoric said...

Have you tried escaping the quotes?

void = system_exec("\"C:\\Program Files\\testWe.exe\"", 2) 

Ok, so it works. Now the real problem and more difficult. Consider that "euwc" is in my path

void = system_exec("exwc \"C:\\Program Files\\testWe.EXW\"", 2) 

How to make this line work?

Can you clarify the problem? I don't understand. You say "euwc" is in the path, but then you try to use "exwc."

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

10. Re: Run an application in a directory named with spaces

euphoric said...

Can you clarify the problem? I don't understand. You say "euwc" is in the path, but then you try to use "exwc."

I typed wrong. The correct is exwc

I'm referencing exwc.exe

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

11. Re: Run an application in a directory named with spaces

[duplicate post deleted]

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

12. Re: Run an application in a directory named with spaces

sergelli said...
petelomax said...

But you may not have to replace OpenEuphoria

Phix looks good but I have doubts,

Fair enough, that's perfectly understandable, and it is why I said what I said above.

sergelli said...

however I can not I register on Phix forum because the site does not send me e-mail confirmation and there is no way to sent messages to the site administrators

You're not missing much, and you are talking to the site admin (I have been more than a bit lazy in my duties, but I cannot see any attempt to register by you, though I have just authorised 4 accounts, btw)

Pete

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

13. Re: Run an application in a directory named with spaces

sergelli said...
euphoric said...

Can you clarify the problem? I don't understand. You say "euwc" is in the path, but then you try to use "exwc."

I typed wrong. The correct is exwc

I'm referencing exwc.exe

Ah, OK. I figured there was a typo; I just wanted to be sure.

If you just type "exwc" on the command line, what happens?

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

14. Re: Run an application in a directory named with spaces

I just had a similar problem calling system("explorer " & file,0) where one part of the file path contains a space.

abbreviate_path(file) seems to solve the problem.

Give that a try

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

15. Re: Run an application in a directory named with spaces

euphoric said...

Ah, OK. I figured there was a typo; I just wanted to be sure.

If you just type "exwc" on the command line, what happens?

This is what happens

c:\>exwc 
Euphoria Interpreter 3.1.1 for 32-bit Windows. 
Copyright (c) Rapid Deployment Software 2007 
See http://www.RapidEuphoria.com/License.txt 
 
file name to execute? 
new topic     » goto parent     » topic index » view message » categorize

16. Re: Run an application in a directory named with spaces

irv said...

I just had a similar problem calling system("explorer " & file,0) where one part of the file path contains a space.

abbreviate_path(file) seems to solve the problem.

Give that a try

Any program that exists out there, open files in folders named with letters and spaces. I wanted my programs made with Euphoria, do the same thing.

I know this is possible, but far as I know it requires extra programming that transforms long names in 8.3 format and does not always work well.

It would be great if the Euphoria language would be responsible of solving this problem.

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

17. Re: Run an application in a directory named with spaces

Since long filenames with spaces work just fine with eui on Linux without any extra work, it appears this is a problem caused by Windows.

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

18. Re: Run an application in a directory named with spaces

sergelli said...
euphoric said...

If you just type "exwc" on the command line, what happens?

This is what happens

c:\>exwc 
Euphoria Interpreter 3.1.1 for 32-bit Windows. 
Copyright (c) Rapid Deployment Software 2007 
See http://www.RapidEuphoria.com/License.txt 
 
file name to execute? 

I just did this on my commandline:

c:\>eui "c:\Users\FOADDEV\Programs\iNet System\iNet_Administrator.exw" 

And it worked fine. Can you do the same thing from your commandline (except using exwc and your own program path/name)?

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

19. Re: Run an application in a directory named with spaces

euphoric said...

I just did this on my commandline:

c:\>eui "c:\Users\FOADDEV\Programs\iNet System\iNet_Administrator.exw" 

And it worked fine. Can you do the same thing from your commandline (except using exwc and your own program path/name)?

exwc or eui both work well on the command line, even if they have to go through a folder with names with spaces.

But as I said earlier, do not work within a Eu code.

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

20. Re: Run an application in a directory named with spaces

As per documentation (euphoria-4.0.5.pdf):

On WINDOWS, system exec() does not allow the use of command-line redirection in command. Nor does it allow you to quote strings that contain blanks, such as file names.

mike

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

21. Re: Run an application in a directory named with spaces

A possible solution, somewhat of a kludge...
Get your Euphoria app to create a batch file that contains the problematic path.
Then use system_exec to call the bat file.

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

22. Re: Run an application in a directory named with spaces

sergelli said...

But as I said earlier, do not work within a Eu code.

Have you tried builtins\syswait.ew yet? (as per 7. above)

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

Search



Quick Links

User menu

Not signed in.

Misc Menu