[DGD] Running a DGD mud on Linux

Jay Shaffstall jshaffst at netwalk.com
Wed Apr 23 15:33:34 CEST 2003


Noah,

I've been prettying up output lately, and wrote a simple method in STRINGD 
to pad a string out to some length (after having run into the problem of 
different tab lengths on different telnet clients).  The method is 
below.  There's probably a more efficient way of doing the padding, but 
this one works fast enough for my purposes.

I'm still working on trying to parse the process id out of a ps listing, to 
be able to kill an unresponsive server.  Too bad the process id isn't one 
of the items returned by DGD in the status array.

Jay

string pad (string str, int length, string char)
{
	string result;
	int i;

	result = str;

	for (i = strlen (str); i < length; i++)
		result += char;

	return result;
}

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list