Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!im4u!rutgers!sri-unix!sri-spam!ames!ucbcad!ucbvax!decvax!tektronix!tekcrl!tekgvs!toma From: toma@tekgvs.TEK.COM (Thomas Almy) Newsgroups: comp.sys.ibm.pc Subject: Cannot putenv() in MSC 4.0 Message-ID: <2301@tekgvs.TEK.COM> Date: Mon, 18-May-87 17:24:26 EDT Article-I.D.: tekgvs.2301 Posted: Mon May 18 17:24:26 1987 Date-Received: Wed, 20-May-87 02:19:04 EDT Reply-To: toma@tekgvs.UUCP (Thomas Almy) Distribution: na Organization: Tektronix, Inc., Beaverton, OR. Lines: 28 Keywords: pushd,popd,putenv,Turbo Pascal,Microsoft C V4.0 I had been using a clever version of PUSHD/POPD, written in Turbo Pascal, which saved the directory stack in an environmental variable string. (This program was posted here about a year ago). Well it worked fine until my environment became greater than 20 paragraphs. At that point the Turbo program dies because the maximum string size in Turbo is 255 characters. Noticing the existance of getenv and putenv (yes!) in Microsoft C, I decided to rewrite these programs. After all, the hard work in the Turbo program was to do the getenv and putenv operations. Writing these programs in C should have proved to be a snap. But putenv() does not appear to actually set the environment! Just the one local to the program! What good is this?? Considering this, the example program in the Microsoft manual (which sets the path) is completely worthless. I suppose I should have known better since Microsoft C's library is supposed to mimic *NIX as close as possible and putenv won't work there either! Now it looks like I will have to rewrite putenv() (using the Turbo version as a guide), but before I do, has anyone done this already? Or is there a public domain PUSHD/POPD out there that will do the job? Tom Almy