HDTenEightyP/NetNews huggingface dataset:
From: pf@bilbo.bio.purdue.edu (Paul Furbacher)
Newsgroups: comp.os.msdos.programmer
Subject: Re: WANTED: Code to search DOS directory/subdirectories
Date: 27 Aug 92 06:42:46 GMT
Distribution: comp.os.msdos.programmer
Organization: Purdue University

In article <1992Aug27.044445.22165@uwm.edu>, 
   rca@csd4.csd.uwm.edu (Robert C Allender) writes:
> 
> I'm trying to find a reasonable block of code that will search through a DOS 
> directory using Turbo C 3.0 in DOS mode.

It appears that you took the following from the TC manual, yet there is at
least one important mistake.  
> eg.
> 
>      { ...
> 
>        struct find_t ffblk;
>        int done;
>        printf("Directory of C:\\\n");
>        done = _dos_findfirst("C:\\*.*",_A_SUBDIR,&ffblk);

The above line has the structure and attribute parameters transposed.
Is the rest okay? (I'll leave that to you.)

>        while(!done) 
>        {
>           printf(" %s\n", ffblk.name);
>           done = _dos_findnext(&ffblk);
>        }
>        return 0;
> 
>      } ...

Next, you wrote...

> the _A_SUBDIR is supposed to return only DOS subdirectory entries, however it
> seems to (as do the other alternatives) also return normal files ...

I might be wrong, but it seems that it has been said many times before that 
findfirst() and findnext() find all "normal" files *and* the ones 
specified by the attribute value.  (The manual doesn't say that though.)
At least that's how they worked last time I used them (but that was in TP).  
What you'll have to do is filter out the "regular" files by 
"if (ffblk.ff_attrb && FA_DIREC)..."
or something like that (it's been a while since I talked C).

Since I never took a course in C (learned it in between the real 
stuff I'm supposed to be doing for a living so I could do that stuff
better), why the underscored prefixes, such as _dos_ ?

PF
Newsgroups: comp.os.msdos.programmer
From: ahemming@bmdhh116.bnr.ca (Andrew Hemming)
Subject: Help required to restore IO.SYS
Organization: BNR Europe Ltd, Maidenhead, UK
Date: Wed, 26 Aug 1992 15:35:51 GMT

Hi,
  About six months ago I upgraded to DOS 5, all worked fine until
a couple of months ago. There was I debugging my final year University
project when I started to have problems. Every now and again, when I
ran my program, it would crash, leaving several files open and corrupt.
Only being a poor student I could not afford such luxuries as Norton Utils
etc, so I used good old CHKDSK -f to clear up the mess. This worked fine
for several weeks until on day CHKDSK decided to "fix" my IO.SYS file. UGH!
I am now unable to boot from my hard disk. I can however still access it
by booting from diskette. This is not ideal!

  Does anyone out there know how I can restore my copy of IO.SYS other than
FORMAT C: /S. I have tried the obviouse.

Thanks,

Andy.
Newsgroups: comp.os.msdos.programmer
From: levin@world.std.com (Levin F Magruder)
Subject: Questions about malloc and free and memory models
Organization: The World Public Access UNIX, Brookline, MA
Date: Wed, 2 Sep 1992 03:20:56 GMT

I'm posting here because I think my problems have to do with 
dos, not c.  Correct me if I'm wrong.

The program below does nothing but store lines from a file in
malloced memory and then attempt to free that memory.  I was
getting "exception 13" from QEMM, the manual said that often
meant segment wraparound, which I don't really understand,
but I guessed that using far pointers would make it less likely,
and it seems to've worked.  But now the compiler (Borland C++ 2.0)
complains about suspicious pointer conversions.

Can someone point me to an introductory article on pc segments?
Is there a way to avoid dealing with this when using dos?  Or do
I just have a bug in my program?

I also don't understand the numbers I get from coreleft.  They
show memory sucked up after the mallocing, as I'd expect, but 
none freed at all until the very last free, when it is all freed
at once.  I thought this was perhaps because malloc works with
chunks of memory, but even when I do huge files I get the same 
pattern.

------
#include <stdio.h>
#include "lines.h"
#include <alloc.h>

main(int argc, char ** argv)
{
    FILE *infile ;
    struct line linedesc ;
    struct line far *linedescp, far *nextlinep ;
    char buffer[MAXLINE+1] ;

    infile = fopen(argv[1], "rt") ;
    if(infile == NULL)
    {
        printf("Can't open %s for reading", argv[1]) ;
        exit(-1) ;
    }
    printf("before: %u\n", coreleft()) ;
    linedescp = &linedesc ;
    while(fgets(buffer, MAXLINE, infile))
    {
        linedescp->text = (char *) malloc(strlen(buffer)+1) ;
        strcpy(linedescp->text, buffer) ;
        linedescp->next = (struct line far *) malloc(sizeof(struct line)) ;
        linedescp = linedescp->next ;
    }
    linedescp->text = NULL ;
    linedescp->next = NULL ;
    printf("after: %u\n", coreleft()) ;

    /* now free it all */

    linedescp = &linedesc ;
    while(linedescp->text != NULL)
    {
        free(linedescp->text) ;
        nextlinep = linedescp->next ;
        free(linedescp) ;
        linedescp = nextlinep ;
     }
     printf("Before last free: %u\n", coreleft()) ;
     /* freed all but last element.  free the linedesc, but nothing was
        malloced for text, so don't free -> text */
     free(linedescp) ;
     printf("After last free: %u\n", coreleft()) ;
     return ;
}
---lines.h---
struct line
{
    char *text ;
    struct line far *next ;
    struct line far *prev ;
} ;

#define MAXLINE 200
Xref: sparky comp.os.msdos.programmer:8873 comp.os.msdos.misc:4945
From: rice@ttd.teradyne.com
Newsgroups: comp.os.msdos.programmer,comp.os.msdos.misc
Subject: Re: Disk Drive Purchase?
Date: 28 Aug 92 19:39:39 GMT
Distribution: na
Organization: Teradyne Inc., Telecommunications Division

In article <1992Aug26.183636.12146@jts.com>, pat@jts.com (Patrick Perroud ) writes:
> I will be purchasing a disk drive in the near future and was wondering if
> anybody had any thoughts on the type, speed etc. (ESDI vs. SCSI).
> I was looking in the 200MB range. My present system config is 386SX-16,
> 40MB ESDI drive. I may in the near future be upgrading to a faster system,
> eg. 20-33MHZ or better and would like to use the disks, so this may be a
> factor in selecting the disk ie. speed etc. Also cost may be a factor.
> 
> Any suggestions would be greatly appreciated.
> 

I'm running a pair of 200MB Seagate IDE drives (ST1239A) in my 486. They're
fast (15ms access) reliable and I've been very happy with them. I have an 
ST1144 (130mb IDE) in a 386 that's also been fine. 

The only problem I've had, is that one of the 200s initially was heat sensitive
and the data transfer rate would slow, when it got hot. Took it back to the
dealer (within the waranty period) and it was replaced on the spot (Seagate's
policy).

My personal preference is for IDE over SCSI, only because from what I read,
SCSI seems to be a constant battle with incompatible drivers, every time you
want to add another different SCSI device (like a CD-ROM or another SCSI
drive). Windows 3.1's also 'fussy' about SCSI. On the other hand, the IDE
drives don't need special drivers and work fine with Windows.

Hope this is usefull.

> -- 
> 
> 
> 
> Pat P.
-- 
   John Rice        K9IJ     |  "Did I say that ?" I must have, but It was
                             |   MY opinion only, no one else's...Especially
                             |   Not my Employer's....
   rice@ttd.teradyne.com     |   Purveyor of Miracles,Magic and Sleight-of-hand
Newsgroups: comp.os.msdos.programmer
From: Ross Ridge <ross@zooid.guild.org>
Subject: Re: The Box-Drawing Charachters
Organization: ZOOiD BBS
Date: Tue, 1 Sep 1992 20:28:49 GMT

falk@peregrine.Sun.COM (Ed Falk) writes:
>Go look at IBM's EBCDIC character set (where, for example, '~' comes
>between 'r' and 's') and ask yourself if you'd dream of finding some
>sort of organization in their extended IBM ASCII character set.

Actually EBCDIC makes some sense if you're using punched cards (in fact
a lot of IBM things make sense if you think of punched cards), but if
you ever think you might be able to make sense of IBM's extended
character set (don't call it ASCII, ANSI had nothing to do with it),
just look at another code page.

							Ross Ridge

-- 
Ross Ridge - The Great HTMU					     l/	 //
								    [OO][oo]
ross@zooid.guild.org						    /()\/()/
uunet.ca!zooid!ross						     db	 //
Newsgroups: comp.os.msdos.programmer,comp.os.ms-windows.programmer.tools
From: djbailey@skyler.mavd.honeywell.com
Subject: Request for deveopment tool advice
Organization: Honeywell Systems & Research Center
Date: Mon, 31 Aug 1992 17:21:44 GMT

The Problem

I  want  to  change the user interface of a CPU intensive application
running  under MS-DOS to support a mouse and display simple graphics.
I  am an experienced programmer but have little MS-DOS experience and
no  Windows  experience.  I am looking for advice on what tools would
make the job easier. 

I  prefer  to  use tools I already have so I don't have to go through
the  accounting  and  sign-off  process  but  I  can  spend money for
something  new  if  the  tool  is  worth it. I have to learn some new
development  package  but I don't want to learn a half dozen in order
to pick one. (I'm looking for the right FM to RT.)

	The Application

My application is a C program. It is CPU intensive with limited user
interaction. I can tolerate a 33% loss of efficiency to improve the
user interface. We are adding the ability to accept interrupts from
some  special  devices.  The  application  will  display  text  in a
scrolling  window  and  will sometimes ask the user to enter a small
string. 

We  have  moved the application from VAX/VMS to MS-DOS 5.0. I want to
add  about  20  virtual  lighted  buttons and detect mouse clicks and
function  keys  to  set  or  reset the 20 buttons. I need a small 1/4
screen area to display the buttons that will not get disturbed by the
application's scrolling text.

The Tools Available.

The application was written in Microsoft C version 7.0. We have the 
Windows  Development  Kit  and class libraries that come with version
7.0.  We  also have purchased a copy of C-Worthy. We have a shareware
package called the Window Boss for evaluation. We have LabWindows
available.

I have demo packages for Vermont Views, Panel Plus II, and HIM (Human
Interface  Manager).  I  have  read the articles in the September and
October  1991  issues  of  Computer Language magazine about Interface
Building tools and I am still uncertain about which tools to use.

I  am  presently  digging  into  the  documentation  for  the Windows
Development  Kit.  I hope for some guidence to shorten my search. Any
general  advice  for  a  first-time  Windows  developer would also be
appreciated.

Hopefully posted by Don J. Bailey of Honeywell Inc. (Minneapolis).
Newsgroups: comp.os.msdos.programmer
From: glen@wench.ece.jcu.edu.au (Glen Harris)
Subject: Re: Can't link in math libs in djgpp - extra info
Organization: Electrical and Computer Engineering, JCUNQ
Date: Sun, 23 Aug 1992 23:17:33 GMT

In article <3269@dozo.and.nl> jos@and.nl (Jos Horsmeier) writes:
>If you compile like this:
>cc -lm myfile.c
>it won't work, you have to change it into this:
>cc myfile.c -lm

  That was the problem.  Thanks to all who replied.
From: tjb@enh.nist.gov
Newsgroups: comp.os.msdos.programmer
Subject: com port problem
Date: 30 Aug 92 22:55:44 GMT
Organization: NIST

Hi,
I have an Xt and a 386,
the XT is connected to a printer and a modem
the 386's COM2 is connected to the XT's COM1 through a null-modem
cable.
i want to be able to use the printer&modem from the 386
i can use the printer using a network program, but it's not compatible
with a lot of stuff, and takes up LOTS of memory.
i wanted to use the modem by writing a small C program that
makes the XT transfer COM1 to COM2 and COM2 to COM1
so that COM2(direct link to XT) on the 386 will function as a modem

  386               XT
 ---------      --------------
  COM2  ->   COM1  ->  COM2  ->  modem
    COM2  <-   COM1  <-  COM2  <-  modem


my program so far is:
---------------------------------------------------------
#include <conio.h>
#include <dos.h>

#define COM1 0x3f8
#define COM2 0x2f8
#define COM1S 0x3fd
#define COM2S 0x2fd

main()
{
        int com1,com1s,com2,com2s;

        while( !kbhit() )
        {
                com1s = inportb( COM1S );
                if( com1s & 1)
                {
                        com1 = inportb( COM1 );
                        outportb( COM2, com1 );
                        printf("got %d from com1\n",com1);
                }
                com2s = inportb( COM2S );
                if( com2s & 1 )
                {
                        com2 = inportb( COM2 );
                        outportb( COM1, com2 );
                        printf("got %d from com2\n",com2);
                }
        }
}

-----------------------------------------------------------
i usually get something like
com1:a
com2:a
com1:t
com2:t
com1:<return>
com2:<return>
com2:10
com1:f
com2:f
com1:<return>
com2:<return>

it seems i have some communication with the modem( it only
gives a line feed after commands beggining with 'at') but
i don't get an OK and i can't dial.
i tried calling first and then activating the program. it seemed to have
sent my keystrokes, but pretty limited( missing return, ctrl-break )
and i didn't get any reasonable things FROM the modem.

does anyone know how to make it work??
Thanks,sOmri Barak
Internet: barak@bguee.bgu.ac.il
Bitnet  : barak@bguee
From: Ralf.Brown@B.GP.CS.CMU.EDU
Newsgroups: comp.os.msdos.programmer
Subject: Re: Novice question: how to boot from a bat file?
Date: 1 Sep 92 13:01:00 GMT
Organization: Carnegie Mellon University School of Computer Science
Originator: ralf@B.GP.CS.CMU.EDU

In article <1992Aug31.214211.20267@midway.uchicago.edu>, pynq@quads.uchicago.edu (George Jetson) wrote:
}Anyway, somebody ought to get Ralf to post the one true solution to the
}auto-reboot program.

It's in the FAQ.

-- 
Internet: RALF+@CS.CMU.EDU   |The University would disclaim this if it knew...
FIDO: Ralf Brown 1:129/26.1  |
BIT: RALF%CS.CMU.EDU@CARNEGIE|"Success has a simple formula: do your best,
AT&Tnet: (412)268-3053 school| and people may like it."   -- Sam Ewing
Newsgroups: comp.os.msdos.programmer
From: buckley@milton.u.washington.edu ( )
Subject:  Capturing keystrokes to a file.
Organization: University of Washington, Seattle
Date: Tue, 25 Aug 1992 19:41:51 GMT

Hello,
  Has anyone written an application to save all
keystrokes to file?  If so, would you have any
source code I could look at (or do you know
of a site that has any such application)?
Thanks,
Jim
buckley@milton.u.washington.edu
Newsgroups: comp.os.msdos.programmer,news.answers
From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
Subject: Re: Smallest TSR (was Re: Why can't I hook INT 21h???)
Organization: Queen's University
Date: Thu, 27 Aug 1992 15:40:41 GMT

In article <BtMG1E.A6D@ireq.hydro.qc.ca> beaurega@ireq.hydro.qc.ca (Denis Beauregard) writes:
>
>But, from first example of a small TSR we got, the program was heavily
>using inline or assembly code using particularities of C to make it
>easier to program in assembly than direct assembly.  However, this is
>ASM, not HLL (high level language).  In other words, it is curious
>to need to use the lower level language to get the more (or the less
>in space occupied) from a higher level language (or isn't it natural :
>the more you know, the more you can do).

Take a look at the entry I just posted.  It's entirely in a high level 
language (Turbo Pascal), using a widely available commercial library (Object 
Professional).  The only place I bent your rules was to make a direct DOS 
call in order to release the environment segment.  It takes 160 bytes, just 
32 bytes more than the original example of a tiny TSR posted by Ralf Brown, 
and performs the same function.

If I'd been allowed to write the ISR part in inline assembler, I don't see 
any reason I couldn't have matched or beaten his record.  The advantage of 
writing in TP (or another HLL) is that the loader part is particularly 
easy to write; all the stuff I did there is commonly available "off the 
shelf".  For example, if I'd wanted to parse complicated command line 
arguments, it would have been easy.  

Duncan Murdoch
dmurdoch@mast.queensu.ca
Newsgroups: comp.os.msdos.programmer
From: hshulman@magnus.acs.ohio-state.edu (Harvey G Shulman)
Subject: Timed batchfile execution
Organization: The Ohio State University
Date: Mon, 31 Aug 1992 18:26:28 GMT

I want to set up a processing job on my PC to start running in the
evening after I've gone home.  Is there a tsr utility available that can 
run a batch file at a  designated time?

Harvey Shulman
Ohio State University
Newsgroups: comp.os.msdos.programmer
From: brown@NCoast.ORG (Stan Brown)
Subject: Re: How can you set an environment variable in a program?
Organization: Oak Road Systems, Cleveland Ohio USA
Date: Wed, 26 Aug 1992 00:34:44 GMT

This is why we have an FAQ list, folks.  Here's the relevant excerpt:

Q704. How can a program set DOS environment variables?

    Program functions that read or write "the environment" typically
    access only the program's copy of the environment.  What this Q
    really wants to do is to modify the active environment, the one that
    is affected by SET commands in batch files or at the DOS prompt.
    You need to do some programming to find the active environment, and
    that programming varies for different versions of DOS.

    A fairly well-written article in {PC Magazine} volume 8 number 20
    (1989 Nov 28), pages 309-314, explains how to find the active
    environment, and includes Pascal source code.  The article hints at
    how to change the environment, and suggests creating paths longer
    than 128 characters as one application.

    In searching Simtel for source code, I found many possibilities.  I
    liked PD1:<MSDOS.SYSUTL>RBSETNV1.ZIP of the ones I looked at (not
    all of them).  It includes some utilities to manipulate the environ-
    ment, with source code in C.

-- 

Stan Brown, Oak Road Systems                      brown@Ncoast.ORG
From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Smallest TSR (was Re: Why can't I hook INT 21h???)
Date: 31 Aug 92 00:38:25 GMT
Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada

In article <1992Aug27.184347.3458@zooid.guild.org> ross@zooid.guild.org (Ross Ridge) writes:
>
>>I have not yet seen an example using the environment space to still
>>use less memory! 
>
>Are you kidding?  Just free it, what use is it?
>

A 13 or so more bytes?  You just have to have the installation program
moving all addresses to the environment space then freeing a few (very few)
more bytes.  BUT, 13 in a 160 bytes is some 8% imporvement.  

>							Ross Ridge
>
>-- 
>Ross Ridge - The Great HTMU					     l/	 //
>								    [OO][oo]
>ross@zooid.guild.org						    /()\/()/
>uunet.ca!zooid!ross						     db	 //


-- 
  \_\    Denis Beauregard  *  internet:beaurega@ireq.hydro.qc.ca
 /   \   Genealogiste officiel : Beauregard/Jarret/Jarest/Vincent
J   __>  Un Quebec renouvele dans une Amerique renovee
\_.-===                                                  Opinions ? Et pis non !
From: cholette@JSP.UMontreal.CA (Cholette Martin)
Newsgroups: comp.os.msdos.programmer
Subject: *************** HELP in DOS 5.0 ******************
Date: 30 Aug 92 01:32:39 GMT
Organization: Universite de Montreal


Hello, I need to concatenate to text files together in DOS 5.0 , I have looked
in many manuals but I can't seem to find the answer. It seems straight
forward enough yet I am unable to find the answer. I need to append to text
files into a single text file a.txt + b.txt -> c.txt

The equivalent of what I need in UNIX is:

                        cat a.txt b.txt > c.txt

Please someone help me, why can't I figure it out???

Martin Cholette
cholette@jsp.umontreal.ca
From: Ross Ridge <ross@zooid.guild.org>
Newsgroups: comp.os.msdos.programmer
Subject: Re: Why can't I hook INT 21h???
Date: Tue, 25 Aug 1992 19:01:35 GMT
Organization: ZOOiD BBS

beaurega@ireq.hydro.qc.ca (Denis Beauregard) writes:
>How could you write a self-moving program in C?  Because to be under 300
>bytes, you have to start at 0x5C in the PSP

You're forgetting about the only really decent "feature" of 8086's
segments, that's terribly easy to relocate code that doesn't make any 
absolute segment references.  So it's not too hard to write a C
programme that can relocate part of itself to PSP:0x60 (aka PSP+6:0).

							Ross Ridge

-- 
Ross Ridge - The Great HTMU					     l/	 //
								    [OO][oo]
ross@zooid.guild.org						    /()\/()/
uunet.ca!zooid!ross						     db	 //
From: cs8023@ee21.ncu.edu.tw (ee76536)
Newsgroups: comp.os.msdos.programmer
Subject: WANTED again:64bits(double long) arthmetics
Date: 1 Sep 92 05:38:02 GMT
Organization: Dep. of EECS, National Central University, Chungli, Taiwan, R.O.C.

Hi, all assembly lang experters:

I recently search a fast 64bit (double long) arthmetics,
if you have any idea on which books/documents/tools, please inform
me, thanks anyway.

(p.s. I wrote one, but inefficient..
anthony
-- 
>>> Anthony Li <Li3, Shih4 Hao2><Li:fruit's Name><Shih:Scholar><Hao:Hero>   <<<
<<< Institute of CSEE, National Central Univ, Chungli, Taoyuan, Taiwan, ROC >>>
>>> Internet:	oper2@ncuee.ncu.edu.tw	    cs8023@ee21.ncu.edu.tw >>>
From: rccarm00@mik.uky.edu (ron c carman)
Subject: How to change file attributes using Turbo C ??
Organization: University Of Kentucky, Dept. of Math Sciences
Date: Tue, 25 Aug 1992 01:57:23 GMT

   I want to be able to change/set the attributes (Hidden, system, etc)
of the files which are used/created by my programs (written in Borland's
Turbo C).  How do I go about this?
   
   Many thanks.

RC Carman

--
/=======================================================================\ 
|       chronos              || 'What you want is irrelevant.           |
| rccarm00@mik.uky.edu       ||  What you have chosen is at hand.'      |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Newsgroups: comp.os.msdos.programmer
From: Ross Ridge <ross@zooid.guild.org>
Subject: Re: Smallest TSR (was Re: Why can't I hook INT 21h???)
Organization: ZOOiD BBS
Date: Thu, 27 Aug 1992 18:43:47 GMT

beaurega@ireq.hydro.qc.ca (Denis Beauregard) writes:
>But, from first example of a small TSR we got, the program was heavily
>using inline or assembly code using particularities of C to make it
>easier to program in assembly than direct assembly. 

My example used no inline or assembly code.  It did however make extensive
use of Borland C extensions, but this is still HLL programming.

>I have not yet seen an example using the environment space to still
>use less memory! 

Are you kidding?  Just free it, what use is it?

							Ross Ridge

-- 
Ross Ridge - The Great HTMU					     l/	 //
								    [OO][oo]
ross@zooid.guild.org						    /()\/()/
uunet.ca!zooid!ross						     db	 //
From: huisjes@cs.vu.nl (Huisjes M)
Newsgroups: comp.os.msdos.programmer
Subject: I/O PORTS ???
Date: 27 Aug 92 13:06:54 GMT
Organization: Fac. Wiskunde & Informatica, Vrije Universiteit, Amsterdam
Originator: huisjes@kappl.cs.vu.nl

Does anybody know where to find a book/article/file on MS-DOS I/O ports?
In my DOS manual there is only a short list of which ports there are, but
I would like to know exactly WHICH ports there are and HOW to program them.
Thanx in advance, everybody!
-- 
		Michiel Huisjes.  (huisjes@cs.vu.nl)
		       ..!uunet!cs.vu.nl!huisjes

		/* Reality is for those who can't face science fiction.*/