TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Bob Lawrence
from: Paul Edwards
date: 1996-11-29 15:25:14
subject: posix

PE> I checked the posix standard, stat() is in there, operates on a
PE> filename, include  and  to get it. The
PE> dates are all of type time_t, so you can use strftime() on
PE> them.

BL> Borland says the opposite about their stat struct, but strftime()

For starters, practically all implementations make time_t a long or
unsigned long, which is the number of seconds since 1970.  POSIX just makes
it compulsory.

BL> won't work in Unix anyway. I've had to write my own. What I am trying

strftime() is ISO, and works under Unix.

BL> to do is write a library of simple file and directory functions that
BL> will work DOS/Windows/UNIX. 

strftime() isn't a directory function, but it's ISO anyway.

BL> If you just call stat() and use the struct as time_t you will get 
BL> daylight savings time for New York (that's what *I* got, anyway). To
BL> make stat() work you have to explicity put 

BL> timezone = 0;
BL> daylight = 0;

Try setting the TZONE environment variable.

BL> and then ctime() won't work!

Says who?  Anyway, to fix the New York thing, see if it uses the TZ
environment variable, ie try "set TZ=EST-10", you can use
localtime() instead of gmtime()?

BL> I love C. It's such a great language... and so portable, too.

It is.  What are you comparing it to, BTW?  Something which won't even
*compile* under Unix?

PE> The Posix standard further restricts time_t to be the number of
PE> seconds since 1970, although they don't make that clear

BL> I thought Borland made it pretty clear it wasn't. But I can't use

What exactly did Borland say, given that *their* time_t *is* the number of
seconds since 1970?

BL> the time_t variable anyway, in UNIX. 

You can.  Where did you read that you couldn't, btw?

PE> (Posix was created by dickheads - who else would make fork()
PE> part of the standard when hardly anyone can do one of them, and
PE> most people really are just trying to do an spawn() when they
PE> use fork() (because they follow it with an exec())).

BL> You used one too many brackets.

Read it again.  BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.