Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Shell Execute primitive - What can it actually do?

For general discussion related FlowStone

Shell Execute primitive - What can it actually do?

Postby kortezzzz » Sun Sep 11, 2016 5:48 pm

Hi guys,
Seems like we all know that the "Exec" primitive can call windows features and commands (even under cmd), but where can we find the full list of commands and features that can be used with this primitive? Is there any known documents that specify them? If anyone knows, please shed some light. I really would like to learn this aspect in FS, and I believe that many other would too.

Cheers!
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Shell Execute primitive - What can it actually do?

Postby tulamide » Sun Sep 11, 2016 6:17 pm

Sorry to disappoint you, but Shell Execute ("Exec") does nothing else than starting an external executable (=application). If that program understands command line arguments (for example the windows .exe tools) you can additionally pass them. And that's all.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Shell Execute primitive - What can it actually do?

Postby kortezzzz » Sun Sep 11, 2016 10:19 pm

Thanks for the answer, tulamide. But AFAIK, it can call the cmd command. For instance, if I would like to make my application rename files, I believe it should be possible with this primitive, doesn't it?

Here, take a look at the example I've uploaded:

It uses the cmd command to create new folder. Can it use the cmd to rename files? or delete them? or whatever cmd can do?
Attachments
(create folder).fsm
(580 Bytes) Downloaded 907 times
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Shell Execute primitive - What can it actually do?

Postby tulamide » Sun Sep 11, 2016 10:27 pm

Everything that ends in .exe can be executed by the Prim. CMD.exe is no exception from the rule. So, yes, you can start cmd.exe and give it some arguments to work with.

But you don't need that to rename files. It's quicker and easier with Ruby.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Shell Execute primitive - What can it actually do?

Postby kortezzzz » Mon Sep 12, 2016 1:29 am

But you don't need that to rename files. It's quicker and easier with Ruby.


Well, can't wait to see a little schematic as a authentication. Can we please have it? :D
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Shell Execute primitive - What can it actually do?

Postby tulamide » Mon Sep 12, 2016 2:19 am

kortezzzz wrote:
But you don't need that to rename files. It's quicker and easier with Ruby.


Well, can't wait to see a little schematic as a authentication. Can we please have it? :D

Why do you always question my abilities? Here you are. But in general, when I just point to an alternative way I don't see myself in the need of posting a schematic (imagine you'd talk about a reverb and I'd say "convolution is giving better results") ;)
Attachments
rename_r02.fsm
(428 Bytes) Downloaded 883 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Shell Execute primitive - What can it actually do?

Postby kortezzzz » Mon Sep 12, 2016 9:47 am

Why do you always question my abilities?


Sorry tulamide, It's kinda teasing humor that might work pretty well on some women as well 8-)
Besides, what's the point in telling someone that you know the answer without telling it? It's like someone asking somebody in the street "Excuse me, do you what time is it?" and get only "Yes" as an answer :lol:

Thanks a lot for your effort, buddy. Highly appreciated. That's very helpful tool and moving straight to my over-crowded toolbox. Hope others will find it helpful as well :D
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Shell Execute primitive - What can it actually do?

Postby kortezzzz » Mon Sep 12, 2016 10:29 am

Update:

I'm getting an error message from ruby:

Errno:(in method 'event')::EINVAL: Invalid argument

Any ideas?
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Shell Execute primitive - What can it actually do?

Postby tulamide » Mon Sep 12, 2016 7:42 pm

kortezzzz wrote:It's like someone asking somebody in the street "Excuse me, do you what time is it?" and get only "Yes" as an answer :lol:

That's not the correct picture. This thread was about the exec prim, and I did my best to answer your questions -> I told you the time. But then I added that a watch would be the quicker way to tell the time, and that someone on the street says "Is it? So give me a watch then."

Regarding your issue. That's a system error, not a Ruby error, which means you messed up the path somehow. Make sure it contains only valid signs and also no hidden characters (like carriage return, line feed, tab etc.)
The first string is expected to be the full path to the file, including the file. The second string is expected to be just the new filename. Example:

C:\superfolder\interesting\a_file.txt
awesome_text.txt
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Shell Execute primitive - What can it actually do?

Postby kortezzzz » Mon Sep 12, 2016 11:45 pm

.That's not the correct picture...


That's why I like you. You become tough on some conditions, but still tend to help, so you can have my watch any time you need it. Just let me know ;)

I've never messed up with my system, so the error must be caused by providing the full path's name+file name at the second string line. I'll test it again ASAP, once I'm home.

Thanks again, champ 8-)
Last edited by kortezzzz on Tue Sep 13, 2016 4:23 am, edited 1 time in total.
User avatar
kortezzzz
 
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Next

Return to General

Who is online

Users browsing this forum: No registered users and 75 guests