[news.software.b] Dates in C-news

stealth@caen.engin.umich.edu (Mike Peltier) (01/22/90)

Why was the format of the date field in the history file changed
to a non-human-readable format?  I get the idea that it probably
saves a bit of processor speed for the program, but it's kind of
a pain to see a series of numbers when I want a quick and easy
way to check the status of my newsfeed.  Any other ways to do
this?  Thanks...

tale@cs.rpi.edu (David C Lawrence) (01/24/90)

Randal Schwartz <merlyn@iwarp.intel.com> wrote:
> I can write you a Perl program to translate it back, if you insist.

Y'know, as soon as I saw RandalL's name on that article I knew he was
going to offer a perl solution.

In <C68n*p1@cs.psu.edu> flee@shire.cs.psu.edu (Felix Lee) writes:
> Conversely, you can use
>          $NEWSBIN/getdate now 'now -1 day'
> to find out that it's now 633139077, and yesterday was 633052677.

Yes, you can.  That isn't always completely helpful though.  Sometime
last month someone asked me when a group here was created.  I think it
was alt.folklore.computers.  Well, active.times told me it was created
at 628900369.  Using the getdate approach I'd have to make a couple of
guesses to narrow it down a little and even then I'd have to spend
some extra time if I wanted to make it really accurate.  So I just
threw this trivial excuse for a programme in $NEWSBIN/maint/undate
and have found it handy when looking at a couple of times stored by C
News. 

Error is checking is non-existent -- non-numeric arguments all just
get turned into 0 by atol() and give you back the beginning of the
Unix epoch.  I don't really care; works just fine for my needs.

--
#include <stdio.h>
#include <time.h>

int
main (argc, argv)
     int argc;
     char **argv;

{
  extern long atol();
  long clock;
  
  if (!--argc) {
    (void)fprintf(stderr,"Usage: %s seconds_since_unix_epoch [...]\n",argv[0]);
    exit(1);
  }

  while (argc--) {
    clock = atol(*++argv);
    (void)fputs(ctime(&clock), stdout);
  }

  exit(0);
}

tale@cs.rpi.edu (David C Lawrence) (01/24/90)

In <XJWGA+@rpi.edu> I offered a really dinky programme which all in
all was even dumber than I thought.  Geoff Collyer has just pointed out
to me what an idiot I am (well, he was nicer than that) because
"ctime" already exists in $NEWSBIN/maint.

Duh.

His even rejects bogus options, though the message seems a little off.
It basically does the same thing as what I posted.  I'll just use that
now.

Dave
-- 
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

jwc@unify.uucp (J. William Claypool) (01/25/90)

In article <XJWGA+@rpi.edu> tale@cs.rpi.edu (David C Lawrence) writes:
>Randal Schwartz <merlyn@iwarp.intel.com> wrote:
>> I can write you a Perl program to translate it back, if you insist.
>
>Y'know, as soon as I saw RandalL's name on that article I knew he was
>going to offer a perl solution.
>
>In <C68n*p1@cs.psu.edu> flee@shire.cs.psu.edu (Felix Lee) writes:
>> Conversely, you can use
>>          $NEWSBIN/getdate now 'now -1 day'
>> to find out that it's now 633139077, and yesterday was 633052677.
>
>Yes, you can.  That isn't always completely helpful though.  Sometime
>last month someone asked me when a group here was created.  I think it
>was alt.folklore.computers.  Well, active.times told me it was created
>at 628900369.  Using the getdate approach I'd have to make a couple of
>guesses to narrow it down a little and even then I'd have to spend
>some extra time if I wanted to make it really accurate.  So I just
>threw this trivial excuse for a programme in $NEWSBIN/maint/undate
>and have found it handy when looking at a couple of times stored by C
>News. 

What's wrong with $NEWSBIN/ctime?
-- 

Bill Claypool    +1 916 920 9092 | I know what I know if you know what I mean
jwc@unify.UUCP                   |--------------------------------------------
  ...!{csusac,pyramid}!unify!jwc |   SCCA SFR Solo II   74 es  1984 CRX 1.5

lehtonen@cs.Helsinki.FI (Tapio Lehtonen) (02/26/90)

Is there a getdate program that doesn't expect to find a library
function getdate? AIX PS/2 version 1.1 does not have that getdate.

I have stumbled to umpteen problems trying to get cnews running on 
AIX PS/2. There seems to be good comment on the january patch, it might
be helpful if only I could get it. So, where can I ftp the current
version of cnews sources?
-- 
Tapio Lehtonen                        PHONE + 358 0 7084206
Dept. Comp. Sci., Univ. of Helsinki   TELEX 122785 TSK SF  FAX 708 4441
Teollisuuskatu 23, SF-00510 Helsinki  INTERNET lehtonen@cs.Helsinki.FI
Finland                               LEHTONEN@FINUH    HYLK::TLEHTONEN

moraes@cs.toronto.edu (Mark Moraes) (02/27/90)

>Is there a getdate program that doesn't expect to find a library
>function getdate? AIX PS/2 version 1.1 does not have that getdate.

Look in libc/getdate.y.  This assumes that AIX comes with yacc.

>I have stumbled to umpteen problems trying to get cnews running on 
>AIX PS/2.  There seems to be good comment on the january patch, it might
>be helpful if only I could get it. So, where can I ftp the current
>version of cnews sources?

Time for the usual repeat (No, Ed, you neednt forward this to
comp.archives!): At present, the latest version of C News may always
be obtained by anonymous ftp from cs.toronto.edu (128.100.1.65) in
pub/cnews.Z, all the patches are in pub/cnews.patches.  (Please do not
ftp during peak hours, 0900-1800 EST.  The machine is a heavily used
file/compute server)

Since utzoo has recently started to answer to zoo.toronto.edu, to the
shock and horror of the world at large (Extra! Extra! Imminent death
of Usenet forecast), it will probably take over the role of official C
news repository once Henry and His ftp daemon reach an agreement over
security holes, lint violations and other aspects of coding style.
Last I heard, the ftp daemon was getting the worst of the
negotiations...:-)

	Mark.

henry@utzoo.uucp (Henry Spencer) (02/27/90)

In article <4259@hydra.Helsinki.FI> lehtonen@cs.Helsinki.FI (Tapio Lehtonen) writes:
>Is there a getdate program that doesn't expect to find a library
>function getdate?

No, the function is necessary -- it does all the work.

> AIX PS/2 version 1.1 does not have that getdate.

The getdate library function is part of the C News library; if your
compiler is complaining that it can't find it, something is wrong.

>... So, where can I ftp the current version of cnews sources?

  The current cnews.Z can currently always be retrieved by anonymous ftp from
  neat.cs.toronto.edu in file pub/cnews.Z and the complete set of patches can
  also be found on neat.cs.toronto.edu in the directory pub/cnews.patches.
  For people with broken name servers: neat.cs.toronto.edu is 128.100.1.65
  FTP during our peak hours (13h00-17h00 Eastern) is not encouraged.
-- 
"The N in NFS stands for Not, |     Henry Spencer at U of Toronto Zoology
or Need, or perhaps Nightmare"| uunet!attcan!utzoo!henry henry@zoo.toronto.edu