[comp.sys.ibm.pc.programmer] MSC and UN*X functions utime

minar@reed.bitnet (Nelson Minar,(???)) (06/08/90)

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.

grimlok@hubcap.clemson.edu (Mike Percy) (06/08/90)

minar@reed.bitnet (Nelson Minar,(???)) writes:

>Summary - are there replacements for utime() and tempnam() for Turbo C 2.0?
>PD sources are ideal, but I'll take anything.
 
My mail bounced (surprise! surprise!)

Check out getftime() and setftime() and mktemp() in your TurboC manual.

bobmon@iuvax.cs.indiana.edu (RAMontante) (06/08/90)

(In addition to setftime()/getftime() and mktemp(),) take a look at
tmpnam() and tmpfile().  Note, no `e' in the name.  TC claims these
are unix-available, and our ULTRIX manpage references `tmpnam()' and
`tempnam()' together.  They apparently differ in selection of directory.