Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!eurifb!euraiv1!aiv From: aiv@euraiv1.UUCP (Eelco van Asperen) Newsgroups: comp.sys.ibm.pc Subject: Re: Need help (Turbo C program) Message-ID: <577@euraiv1.UUCP> Date: Tue, 28-Jul-87 07:45:42 EDT Article-I.D.: euraiv1.577 Posted: Tue Jul 28 07:45:42 1987 Date-Received: Wed, 29-Jul-87 05:23:54 EDT References: <306@qtc.UUCP> Organization: EUR/EF/AIV,PObox 1738,Rotterdam,Neth. Lines: 77 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....