Currently shell() doesn't return STDOUT it for some reason only returns 0
My request is that shell() returns STDOUT, instead of having us write and read files over and over which causes unnecessary I/O on the disk.
1
2
ID:1604013
Jun 18 2014, 5:44 pm
|
|||||||
| |||||||
Jun 19 2014, 8:13 am
|
|
^ Second.
|
Agreed, but in the meantime you can write a fairly compact DLL/SO file that does this, I did it myself a while back.
|
In response to Nadrew
|
|
Nadrew wrote:
Agreed, but in the meantime you can write a fairly compact DLL/SO file that does this, I did it myself a while back. Are you able to supply the DLL/SO ? Thanks. |
^ @A.T.H.K it's quite a small task so if Nadrew can't supply it, I'll create one for you
|
Not to go too off topic, but what are the requirements on DLLs being called by call()?
I thought I heard you needed to use C or something. Is there anything I should know before attempting one? If anything I'd just google how to create a DLL and go from there. Sadly I'm mostly experienced in c# and suck in c/c++ |
You create a C++ project for a .dll and use extern "C" __declspec and such.
This will allow BYOND to call the function/the .dll to export the function. The example in the guide was a poor one, but it's an example nonetheless. |
In response to Ssj4justdale
|
|
Ssj4justdale wrote:
You create a C++ project for a .dll and use extern "C" __declspec and such. I mean, I can take what's in the guide and use it. I just don't understand what it's doing. |
That example just merges strings together.
The strcat function copies the source and appends it to the desination. strcat(buf,v[i]) //taken from the guide |
Also, extern "C" means that you can use C in C++ because you are "linking" the two.
|
Ah, thanks for that information. I'll refer to this thread when making my own. :)
|
Want me to share my .dll for it with you A.T.H.K? I just ran tests and it's also 3x faster than BYOND's built in shell() command. That's without BYOND getting a return value as well.
|
If you do, it could be found here:
http://www.ssj4justdale.byethost13.com/res/Snippet_src.zip How to use it: mob/verb/Test(T as text) |
You shouldn't be linking to stray dll files like that, virus scanners hate that a lot -- you should package it up with the source and the dll into a zip or something so people aren't just downloading a random dll file without context =P
|
1
2