PDA

View Full Version : CP/M 2.2 C source to do a directory?



alank2
August 3rd, 2016, 06:24 AM
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

krebizfan
August 3rd, 2016, 08:37 AM
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.

alank2
August 3rd, 2016, 09:25 AM
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.

JonB
August 3rd, 2016, 11:41 PM
Just a thought, but have you considered using Kermit?

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

alank2
August 4th, 2016, 04:09 AM
Hi Jon,


Just a thought, but have you considered using Kermit?

I hadn't, but I will check it out.


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

Excellent; Grant really did a great job with the multicomp all right!