[comp.sys.ibm.pc] NEED HELP

ed@qtc.UUCP (Ed Lisle) (07/16/87)

Ok - I need some help in the following Turbo C program.  All I want to 
do is a directory and save the filenames away to be played with later on.
Here it is.  Thanks in advanced.

What happens is "file_list" contains garbage.
-------------------------------------------------------------------------

#include <stdio.h>
#include <dir.h> 

#define FILE_LEN 13

main(argc, argv)
int argc;
char *argv[];
{
    int i;
    int done;
    int count;
    char pattern[80];
    char file_list[FILE_LEN*50];
    struct ffblk fcb;

	if (argc != 2)
		strcpy(pattern, "*.*");
	else
		strcpy(pattern, argv[1]);

	count = 0;
	done  = findfirst(pattern, &fcb, 0);
	while (!done) {
		strncat( &file_list[count*FILE_LEN],
			 fcb.ff_name,
			 FILE_LEN );
		++count;
		done = findnext(&fcb);
	} /* End while */

	printf("count: %d\n", count);
	for (i=0; i<count; ++i)
		printf("%d %s\n", i*FILE_LEN, file_list[i*FILE_LEN]);

} /* End */

-------------------------------------------------------------------------

        +------------------------------------------------------------+
        |  Ed Lisle                             |   ogcvax!          |
        |  Quantitative Technology Corporation  |   verdix!  qtc!ed  |
        |  Beaverton, OR        (503) 626-3081  |  sequent!          |
        +------------------------------------------------------------+

davidr@hplsla.HP.COM ( David M. Reed) (07/24/87)

I am not an authority, and am only slightly familiar with C, but I also had
some problems with directory listings when attempting such (in Turbo Pascal).
The item I see missing from your code (and maybe it is in dir.h or somewhere
else) is the DOS function 1A "set dta address" before the call to findfirst.
At least, that was my problem.  I was defining the structure for findfirst to
put its information in, but being a novice programmer, was not aware that I
had to tell DOS explicitly through a separate function call as to just where
the data should be put, and thus was experiencing garbage.

rod@cpocd2.UUCP (Rod Rebello) (07/24/87)

In article <5190001@hplsla.HP.COM> davidr@hplsla.HP.COM (   David M. Reed) writes:
>
>I am not an authority, and am only slightly familiar with C, but I also had
>some problems with directory listings when attempting such (in Turbo Pascal).
>The item I see missing from your code (and maybe it is in dir.h or somewhere
>else) is the DOS function 1A "set dta address" before the call to findfirst.
>At least, that was my problem.  I was defining the structure for findfirst to
>put its information in, but being a novice programmer, was not aware that I
>had to tell DOS explicitly through a separate function call as to just where
>the data should be put, and thus was experiencing garbage.

I didn't see the original code, but in Turbo C, you do not have to
explicitly set the dta address prior to calling findfirst.  This is
handled automatically.  I have used this routine, along with findnext
several times without problems.


	Rod Rebello
	...!intelca!mipos3!cpocd2!rod

null@bsu-cs.UUCP (Patrick Bennett) (07/25/87)

In article <805@cpocd2.UUCP>, rod@cpocd2.UUCP (Rod Rebello) writes:
> I didn't see the original code, but in Turbo C, you do not have to
> explicitly set the dta address prior to calling findfirst.  This is
> handled automatically.  I have used this routine, along with findnext
> several times without problems.

True - TC is very nice about these things...   I believe his problem was
not in his use of findfirst/findnext but in his loop to print out the
filenames...  He was missing the '&' address-of operator before his
array reference to printf.

-- 
----
Patrick Bennett     UUCP:  {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!null

aiv@euraiv1.UUCP (Eelco van Asperen) (07/28/87)

in article <306@qtc.UUCP>, ed@qtc.UUCP (Ed Lisle) says:
> 
> Ok - I need some help in the following Turbo C program.  All I want to 
> do is a directory and save the filenames away to be played with later on.
> Here it is.  Thanks in advanced.
> 
> What happens is "file_list" contains garbage.
...
>     char file_list[FILE_LEN*50];
> 
...
> 	count = 0;
> 	done  = findfirst(pattern, &fcb, 0);
> 	while (!done) {
> 		strncat( &file_list[count*FILE_LEN],
> 			 fcb.ff_name,
> 			 FILE_LEN );
> 		++count;
> 		done = findnext(&fcb);
> 	} /* End while */

You might try to initialize your file_list; you use strncat() to _append_
the filenames !

Eelco van Asperen.

-----------------------------------------+-------------------------------------
Erasmus University Rotterdam             |uucp:mcvax!{eurifb,olnl1}!euraiv1!aiv 
Fac. of Economics, Computer Science Dept.|earn:asperen@hroeur5
PO.box  1738 / 3000 DR  Rotterdam        |       
T H E    N E T H E R L A N D S           |(this space intentionally left blank)
-----------------------------------------+-------------------------------------
From vn Tue Jul 28 11:43:04 1987
From vn Tue Jul 28 11:40:57 1987
Subject: Re: Need help (Turbo C program)
Newsgroups: comp.sys.ibm.pc
References: <306@qtc.UUCP>

in article <306@qtc.UUCP>, ed@qtc.UUCP (Ed Lisle) says:
> 
> Ok - I need some help in the following Turbo C program.  All I want to 
> do is a directory and save the filenames away to be played with later on.
> Here it is.  Thanks in advanced.
> 
> What happens is "file_list" contains garbage.
...
>     char file_list[FILE_LEN*50];
> 
...
> 	count = 0;
> 	done  = findfirst(pattern, &fcb, 0);
> 	while (!done) {
> 		strncat( &file_list[count*FILE_LEN],
> 			 fcb.ff_name,
> 			 FILE_LEN );
> 		++count;
> 		done = findnext(&fcb);
> 	} /* End while */

You might try to initialize your file_list; you use strncat() to _append_
the filenames !

Eelco van Asperen.

-----------------------------------------+-------------------------------------
Erasmus University Rotterdam             |uucp:mcvax!{eurifb,olnl1}!euraiv1!aiv 
Fac. of Economics, Computer Science Dept.|earn:asperen@hroeur5
PO.box  1738 / 3000 DR  Rotterdam        |       
T H E    N E T H E R L A N D S           |(this space intentionally left blank)
-----------------------------------------+-------------------------------------

This is to fool inews into accepting this article that includes more text 
than I added to the original message. Sigh, those programs that try to
teach us mannes can be irritating at times.....

waste of bandwidth..... rising communications costs..... huge phone-bills....
waste of bandwidth..... rising communications costs..... huge phone-bills....

greggt@VAX1.CC.UAKRON.EDU (Gregg F. Thompson) (05/08/89)

	Has anyone upgraded an Epson Equity II+ to a Hauppage 386?  Has anyone
HEARD of a Hauppauge 386 Replacement Motherboard?  How easy is it to upgrade
a motherboard?


-- 
To live is to die, to die is to live forever;			GRegg Thompson
Where will you spend eternity?			     greggt@vax1.cc.uakron.edu

greggt@VAX1.CC.UAKRON.EDU (Gregg F. Thompson) (05/08/89)

	A friend purchased Framework III (lan version) and then purchased
Vianet running off of Starlan cards.  After installing the network he then
discovered that his FrameWork III (LAN VERSION!) did not run because he
didn't have enough memory.  He has only found 1 network running FrameWork III
(lan version), which is Novell.  At the time the person that demonstrated the
network, said that he would need to buy a dedicated server.  I have found 
since then that Novel does have a version of their network that doesn't
require a dedicated server.  I need more information on this!

System setup:
386 Compaq (3 megs of Extended memory, wierd?)
Epson Equity III+

Needs:
Connect the two machines to share data and still run FrameWork

Questions:
1.	Can he keep the Vianet Network and still make FrameWork III work with
	   his setup? (maybe he did something wrong in setting up Vianet?)
2.	Would Novell's non-dedicated fileserver Network run FrameWork III?
	   (where could I get information on their network).
3.	IS there any other network that could do this???


-- 
To live is to die, to die is to live forever;			GRegg Thompson
Where will you spend eternity?			     greggt@vax1.cc.uakron.edu

mark@certes.UUCP (Mark Guidotti) (05/11/89)

Recently, I downloaded a "disk utility" from the OMTI bulletin board in
Mountain View, CA.  The utility is named "HDTEST" and was written by
Jim Bracking.  It is supposed to provide information on disk performance,
which includes interleave optimization.  It also can do a low level drive
format.

I ran this utility on several computers without problems, and was delighted
with the speed improvement resulting from optimized interleave.

HOWEVER, when I ran it on my HOME machine, both 40MB drives suffered what
appears to be damage to track zero, the boot track.  The symptom is that
when the machine is booted, DOS notes that the boot sector is bad and thereafter
refuses to "cd" to either drive C: or D:.  (Drive D: has an extended partition,
Drive E:)  System is DOS 3.30.  The hardware is ok, as other disk utilities 
perform verification without error.

Facing 80MB of data with now way to access it is, to say the least, a chief
factor in my now elevated blood pressure.  I do have a backup, so please, no
lectures.  I would like to avoid the tedium of restoring the disk from 
floppies and would like to learn something from this mishap.  Therefore, I
would like to hear from anyone who knows what goes on in the boot sector
and particularly from anyone who either has or has access to, a utility prog
which can restore or at least allow me to edit track zero.

Norton utilities V3.0 are particularly useless, since they allow editing
only of a disk which DOS recognizes as valid.  Since DOS does not recognize
mine in their current state, Norton won't do the job.

Please e-mail answers to me at the address below, rather than posting to
the net.  Telephone calls are welcome.  If there is sufficient interest or 
technical information, I will be happy to post a summary once my problem is 
resolved one way or the other. 

Thanks in advance for not lecturing.  I hope to learn something great.

Mark Guidotti
Teradyne, Inc.  408-434-0822
........sun!teraida!certes!mark