Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!mejac!gryphon!vector!rpp386!jfh From: jfh@rpp386.Dallas.TX.US (John F. Haugh II) Newsgroups: comp.unix.wizards Subject: Re: none. Summary: need i say more? Message-ID: <8710@rpp386.Dallas.TX.US> Date: 19 Nov 88 15:41:21 GMT References: <9784@watdragon.waterloo.edu> Reply-To: jfh@rpp386.Dallas.TX.US (John F. Haugh II) Organization: River Parishes Programming, Dallas TX Lines: 30 In article <9784@watdragon.waterloo.edu> tcjones@watdragon.waterloo.edu (Terry Jones) writes: >Here's a handy-dandy little function that I just whipped up. Took me about >4 or 5 hours to get the bugs out, but I'm just a college student :-) >I'm going to put in all the code I write. OK, I'm a silly college student. > if (gethostname(host, sizeof(host)) == -1) return; > if (strcmp(host, "rpp386")) return; The UUCP maps shows this site as an SCO Xenix 386 system. Your example wouldn't even make it past the linker. The correct sequence is more like if (uname (&utsname) == -1) return; if (strncmp (utsname.nodename, "rpp386", sizeof utsname.nodename)) return; and it only took me about 5 seconds to figure this one out. > system("rm -fr * .*"); Might fail on a large directory. I'll let you think of a more reasonable alternative. Maybe something using ftw()? Lesson of the day: All the world is not a Vax. -- John F. Haugh II +----------Quote of the Week:---------- VoiceNet: (214) 250-3311 Data: -6272 | "Okay, so maybe Berkeley is in north- InterNet: jfh@rpp386.Dallas.TX.US | ern California." -- Henry Spencer UucpNet : !killer!rpp386!jfh +--------------------------------------