a cp/m BDOS question

a cp/m BDOS question

Post by j.. » Tue, 16 Feb 1993 21:57:32



I'm trying to write so code that accepts an ambiguous file specifier
then for each matched file do something with it.

My code creates an anbiguous FCB (not at 5CH) and then calls BDOS function
17 (dec) Search for First dir. entry, creates a new second FCB for the
found file and then processes the file. The code then loops
on BDOS function 18 (dec) Search for next, doing the same with each
returned directory entry.

If my program simply displays the name of the file returned, all is well
and I have a simple 'DIR' program. However if the program does any disk
access to the file then the search next function seems to repeatedly
return the first entry - it never moves on. Is this a known BDOS
problem ? Do I have to loop and preserve the returned file details,
and use the list to do the processing after the directory has been
scanned 'without interuption'?

Jim Jackson

 
 
 

a cp/m BDOS question

Post by CP/M live » Wed, 17 Feb 1993 20:55:05



> If my program simply displays the name of the file returned, all is well
> and I have a simple 'DIR' program. However if the program does any disk
> access to the file then the search next function seems to repeatedly
> return the first entry - it never moves on. Is this a known BDOS
> problem ? Do I have to loop and preserve the returned file details,
> and use the list to do the processing after the directory has been
> scanned 'without interuption'?

It's in TFM, if memory serves. You can't do anything else with BDOS while
you're doing searches; you have to save all the FCBs you find up and
process them later.

Remember, we're not talking about a re-entrant OS here...
--

Roger Ivie                      "My God! That computer is full of Pentium!

                                 into mutants!"

 
 
 

a cp/m BDOS question

Post by Lindsay Haisl » Thu, 18 Feb 1993 06:01:40



>I'm trying to write so code that accepts an ambiguous file specifier
>then for each matched file do something with it.

>My code creates an anbiguous FCB (not at 5CH) and then calls BDOS function
>17 (dec) Search for First dir. entry, creates a new second FCB for the
>found file and then processes the file. The code then loops
>on BDOS function 18 (dec) Search for next, doing the same with each
>returned directory entry.

>If my program simply displays the name of the file returned, all is well
>and I have a simple 'DIR' program. However if the program does any disk
>access to the file then the search next function seems to repeatedly
>return the first entry - it never moves on. Is this a known BDOS
>problem ? Do I have to loop and preserve the returned file details,
>and use the list to do the processing after the directory has been
>scanned 'without interuption'?

According to Johnson/Laird's "CP/M Programmer's Handbook", whenever a
subroutine is called to get the >next< file, one must execute a Search First
function to re-find the previous file, using the same FCB as was used for
the previous find.  I would assume that the FCB used for providing the ambiguous
file name will contain, following a Search Next, the information necessary
to keep the process in synch.  It's been a while since I've worked with
these functions, so I can't give better details.

--
"Everything works if you let it"    |                Lindsay Haisley

                                    |                    * * * *
                                    |               Austin, Texas, USA

 
 
 

a cp/m BDOS question

Post by Guy Cousine » Thu, 18 Feb 1993 09:42:05



Quote:

>I'm trying to write so code that accepts an ambiguous file specifier
>then for each matched file do something with it.

>My code creates an anbiguous FCB (not at 5CH) and then calls BDOS function
>17 (dec) Search for First dir. entry, ....
>on BDOS function 18 (dec) Search for next, doing the same with each
>returned directory entry.

>If my program simply displays the name of the file returned, all is well
>and I have a simple 'DIR' program. However if the program does any disk
>access to the file then the search next function seems to repeatedly
>return the first entry - it never moves on. Is this a known BDOS

What you are describing is NORMAL???  There is something that you need to
do but I just can't remember what it is precisely.  From what I recall,
you have to do a SEARCH FIRST on the file you just matched and then follow
with a SEARCH NEXT on the ambiguous FCB....no that does not sound right

I'll have to read MY docs...pull out the 40 K of source code where I have
all this stuff neatly tucked away.  Will re-post when I have the real
answer...ttys

--
Guy Cousineau                  On FidoNet CPMTECH and ADAM echo
Ottawa Canada                  Home RCPM (613) 829-6354  8N1
                               After 11 pm    300-2400 BPS

 
 
 

a cp/m BDOS question

Post by Guy Cousine » Thu, 18 Feb 1993 11:27:08



Quote:

>I'm trying to write so code that accepts an ambiguous file specifier
>then for each matched file do something with it.

I have sent you an E-MAIL with two pages of source code showing roughly
how to proceed to get the SEARCH NEXT to work properly.  The trick is to
save the CURRENT search first file name, do your stuff with the matched
file, restore the search first file name, call SEARCH FIRST and follow
with SEARCH NEXT.  I have used this in an AFN file copy routine for a CCP
and it works just fine.....ttys

--
Guy Cousineau                  On FidoNet CPMTECH and ADAM echo
Ottawa Canada                  Home RCPM (613) 829-6354  8N1
                               After 11 pm    300-2400 BPS

 
 
 

1. C128 BDOS question -- Faster CP/M???

  I was recently llooking through the source code of the BDOS for the C128 CP/M
and noticed that they had an option for use$fast -- apparently to speed up the
Z80 into 4 mhz mode from 2 mhz by toggling the clock speed at the appropriate
points (ie: the clock speed can't be 4mhz when switching processors and a
couple of other similair situations).  However, IT DOESN'T WORK.  I changed the
equate to true (file cxequ.lib). And recompiled the whole thing (talk about
growing old) and no go.
   Any suggestions?  If CP/M on the 128 ran twice as fast I might start using
it more than I do now...

- Craig Taylor

2. Registration

3. CP/M BDOS to Disk Operations on website

4. Error in Modems

5. CP/M BDOS to Disk Operations Part III

6. SNMP Problems with 11.1.8CA1 and 11.1.10CA IOS

7. CP/M BDOS to Disk Operations Updated Part IV

8. HELP: Purchase of CD-R & media

9. CP/M BDOS to Disk Operations Part IV

10. CP/M BDOS to Disk Operations in TXT mode

11. CP/M BDOS to Disk Operations PART II

12. CP/M BDOS to Disk Operations

13. does the CP/M2.2 BDOS produce a WORD for SETTRK?