home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!micro-c!eastwind!entropy!morpheus
- From: morpheus <morpheus@entropy.mcds.com>
- Newsgroups: comp.bbs.waffle
- Subject: something that you'll never use...
- Message-ID: <B0kiwB1w165w@entropy.mcds.com>
- Date: Mon, 28 Dec 92 17:49:34 EST
- Organization: No Pity For The Majority! [private]
- Lines: 58
-
- Short C source follows for a program to display the last connect times for
- sites you talk to. For DOS waffle. Run it in your /spool/status dir. I take
- no responsibility for anything, particularly anything related to overwriting
- other data or tornados. Written for a Borland compiler.
-
- I'm not quite sure why I'm posting this, it just seems to be what people do
- with this kind of stuff... I put it in an extern file so bored users can
- look at it, along with the output of stats. Go figure.
-
- /* shstatus.c */
- #include <stdio.h>
- #include <time.h>
- #include <string.h>
- #include <stdlib.h>
- #include <dir.h>
-
- void main()
- {
- FILE *fp;
- unsigned long ntime;
- struct tm *tst;
- char line[11];
- char *site;
- char *tmp;
- struct ffblk *fin;
- int result;
- int i;
-
- ntime = time(0);
- tst = localtime(&ntime);
-
- printf("Connection status as of %s\n",asctime(tst));
- printf("site \t\tlast connect\n");
- printf("---- \t\t------------\n");
-
- result = findfirst("*",fin,0);
-
- while(result != -1) {
- fp = fopen(fin->ff_name,"r");
- if(!fp) return;
- fgets(line,10,fp);
- *(strchr(line,' ')) = 0;
- ntime = strtoul(line,0,10);
- tst = localtime(&ntime);
- site = fin->ff_name;
- for(i=8-strlen(site);i>0;i--) {
- *(strchr(site,0)+1) = 0;
- *(strchr(site,0)) = ' ';
- }
- printf("%s\t\t%s",strupr(site),asctime(tst));
- result = findnext(fin);
- }
- }
-
-
-
- morpheus@entropy.mcds.com ("morph") | My life is for itself, and not a
- Obsolete diety for hire. Cheap. | spectacle. - Emerson
-