Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!uw-beaver!zephyr.ens.tek.com!tektronix!reed!minar From: minar@reed.bitnet (Nelson Minar,(???)) Newsgroups: comp.sys.ibm.pc.programmer Subject: MSC and UN*X functions utime() and tempnam() for Turbo C 2.0 Message-ID: <15054@reed.UUCP> Date: 7 Jun 90 18:49:03 GMT Sender: news@reed.UUCP Reply-To: minar@reed.bitnet (Nelson Minar) Organization: Reed College, Portland, OR Lines: 37 Sender: Ok. PDMake looks great, terrific, wonderful. It doesn't compile for Turbo C 2.0, as is. First, the stupid thing - how do you do a make without a decent make utility? :) I figured that one out. However, two functions are called in the MSDOS version of PDMake that Turbo C does not know about: utime() and tempnam(). utime(), according to a UN*X man page, changes the file modification/creation time of its first argument, and returns a 0 if all went well, or an errorcode if it didnt (if, for example, the file does not exist). Sounds like touch, right? Well, TC 2.0 does not have this function, and a quick glance through the manual didn't show one that would do the same thing. Currently, I've stubbed utime() to do absolutely nothing (yech). Does such a thing exist, is there a PD version of the function for TC 2.0, or is there a simple way to mimic its behaviour using existing functions (it shouldn't be too hard, but its not obvious to me). tempnam(), according to a UN*X man page, returns a 'safe' temporary file name, with various conventions for what path to put it in, and a caller- optional prefix to prepend. I've currently stubbed it to return the name "make.$$$", although I'll get around to rewriting it to return [prefix]xxxx.$$$, where prefix is the caller-optional prefix, and xxxx is a pseudo-random hex number. Should be passable. Does anyone already have a PD version of this function to save me the trouble of doing it (and maybe doing it wrong). Other than these two small hassles related to compiling under Turbo C (and the fact that the author prototypes none of his functions.. grrrr!), PDmake looks nice. Summary - are there replacements for utime() and tempnam() for Turbo C 2.0? PD sources are ideal, but I'll take anything.