www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/08/19:34:51

Newsgroups: comp.os.msdos.djgpp
From: koehler AT netcom DOT com (Koehler)
Subject: How to get file-globbed names?
Message-ID: <koehlerEr4BDM.Csw@netcom.com>
Organization: Netcom On-Line Services
Date: Wed, 8 Apr 1998 23:17:46 GMT
Lines: 39
Sender: koehler AT netcom13 DOT netcom DOT com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Could some kind person please provide me with a djgpp code example where the
names of multiple ("globbed") files are sequentially processed..... Or 
could someone point me to a (simple!!!!) dos version of grep.

For example, the program I envision would enclude the following:
/*** 
*	eat all files
*/
while(morefiles())
{  
	/***
	*	Get current filename into string fileS
	*/
	GetCurFile(fileS);
	/***
	*	Open and do whatever
	*/
	fPF = fopen(fileS,"r");
	/***
	*	do what ever
	*/
	......
	/***
	*	close and report what ever
	*/
	fclose(fPF);
	printf("File %s had ....\n",fileS);
}

I basicly want a dos grep.
If someone can make the above code work under djgpp, I'll use the example 
and write it myself. I looked at the faq entry about name globbing, but 
didn't see anything about how to actually deal with the resulting 
multiple files; i.e. how to get the file names, opened files, etc..

Thanks in advance for any help
Ryan Koehler

p.s. please reply via email to koehler AT trpntech DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019