Thread View: comp.sys.ibm.pc.programmer
3 messages
3 total messages
Started by Nelson Minar,(???)
Thu, 07 Jun 1990 18:49
MSC and UN*X functions utime() and tempnam() for Turbo C 2.0
Author: Nelson Minar,(???)
Date: Thu, 07 Jun 1990 18:49
Date: Thu, 07 Jun 1990 18:49
37 lines
2329 bytes
2329 bytes
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.
Re: MSC and UN*X functions utime() and tempnam() for Turbo C 2.0
Author: Mike Percy
Date: Fri, 08 Jun 1990 14:54
Date: Fri, 08 Jun 1990 14:54
8 lines
675 bytes
675 bytes
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.
Re: MSC and UN*X functions utime() and tempnam() for Turbo C 2.0
Author: RAMontante
Date: Fri, 08 Jun 1990 16:03
Date: Fri, 08 Jun 1990 16:03
4 lines
733 bytes
733 bytes
(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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads