ID:1604013
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
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.
^ Second.
For sure. ^
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.
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.

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

//buf is the desination/ the text we want to return / the final product

// v[i] is something inside the list/array that we want to append to "buf"
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. :)
No problem, I'll be looking forward to seeing what you come up with :D
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.
I would make a .so but I never made one before haha.
If you do, it could be found here: http://www.ssj4justdale.byethost13.com/res/shell_output.dll

http://www.ssj4justdale.byethost13.com/res/Snippet_src.zip

How to use it:

mob/verb/Test(T as text)
src<<_shell("[T]")

proc/_shell(command_args)
return call("shell_output.dll","shell")(command_args)


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
^ Noted. Will do so now.
Just curious are you able to do in the language BYOND uses and post the source? That way the developers could also use it with next to effort implementing it ;)

But awesome job nonetheless!!
Page: 1 2