• Please review our updated Terms and Rules here

CP/M 2.2 C source to do a directory?

alank2

Veteran Member
Joined
Aug 3, 2016
Messages
2,263
Location
USA
Hi Everyone,

I've been having fun playing with Grant Searle's CP/M on FPGA project. He has a nice utility to download a file from console input to a file, but it only goes from pc->CP/M so I'd like to write a transfer type tool that can do the same thing in both directions. A feature I want is to be able to do wildcards so I can send an entire directory at one time. This is easy to do on the pc side with functions like findfirst and findnext, but I don't see these functions in BDS C on the CP/M side. BDOS does have some functions 17 (F_SFIRST) and 18 (F_SNEXT), but it isn't at all clear to me how I would use them to do wildcard searching like *.TXT, or even if that is what they are supposed to do. Does anyone have some CP/M 2.2 C source that searches a directory with wildcards?

Thanks,

Alan
 
IIRC, BDOS find functions don't work with asterisks but instead you have to manually fill the call with question marks.

Edit: Since you are working with BDS C, look for The CP/M Programmer's Handbook by Andy Johnson-Laird which includes some code for BDS C and a library that might make some of the calls to CP/M easier from BDS C.
 
Last edited:
Thank you; that is exactly what I was looking for. I found the source zip file for this book and it has plenty of functions and code examples that do this and more.
 
Just a thought, but have you considered using Kermit?

(PS, I have a Multicomp running CP/M too, they are brilliant toys. Thanks, Grant!)
 
Back
Top