How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Paul Dufresne
I am trying to translate some C++ code to D to learn D. And the first lines to translate are: signal(SIGINT, (sighandler_t) shutdownClient); signal(SIGTERM, (sighandler_t) shutdownClient); So I come to try: import std.stdio; void main(){ try { while (true) writeln(H1!!); }

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Paul Dufresne
Well, I was looking the documentation and not finding how to catch signals. I thought, hey, does Windows have Posix signals? And the answer seems to be that Windows conform to Posix.1 (which is old, but does define signals)... after all, the code I want to translate does run in MinGW. So, I

Re: How to execute cleanup code on Ctrl-C (Break)?

2012-07-08 Thread Paul Dufresne
Well, I just want to close a socket before quiting if the user press Ctrl-C. That said, looking through the code, I would say that it have no implementation for Windows... even if it should have signals. And even there, I do not really understand how I am suppose to use it. I think it

htod, no version for Linux?

2010-08-17 Thread Paul Dufresne
I downloaded htod.zip and found there is only htod.exe inside. Any version for Linux?

Re: htod, no version for Linux?

2010-08-17 Thread Paul Dufresne
Shouldn't a command line utility like this that doesn't have a lot of external dependencies be trivial to run on Wine? Well, yes, it is just that I have a very slow connection and wine is not already installed.