• Direct directory search algorithm for CP/M3

    From rwdeane@gmail.com@21:1/5 to All on Sun Mar 13 10:44:17 2022
    Does anyone know a method under CP/M 3 of determining the first directory entry for files in a directory, based on only searching the directory block, and not needing to cross refer to other directory entries?

    Under CP/M 2 the first directory entry of a file was identified as having extent number zero. This does not apply under CP/M 3.

    This method is used in the old Andrew Johnson Laird "FIND" program.

    Currently to write a program that shows files across all drives and users I have to use search-first, search-next and set-user bdos calls which is a much slower method.

    Richard

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Elliott@21:1/5 to rwd...@gmail.com on Mon Mar 14 08:08:53 2022
    On Sunday, March 13, 2022 at 5:44:18 PM UTC, rwd...@gmail.com wrote:
    Does anyone know a method under CP/M 3 of determining the first directory entry for files in a directory, based on only searching the directory block, and not needing to cross refer to other directory entries?

    Under CP/M 2 the first directory entry of a file was identified as having extent number zero. This does not apply under CP/M 3.

    This method is used in the old Andrew Johnson Laird "FIND" program.

    Currently to write a program that shows files across all drives and users I have to use search-first, search-next and set-user bdos calls which is a much slower method.

    Under both CP/M 2 and 3, you should AND the extent number with the inverse of the extent mask from the DPB. You should also check that directory byte S2 (offset 0Eh) is zero.

    --
    John Elliott

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rwdeane@gmail.com@21:1/5 to John Elliott on Mon Mar 14 10:22:53 2022
    On Monday, 14 March 2022 at 15:08:54 UTC, John Elliott wrote:
    On Sunday, March 13, 2022 at 5:44:18 PM UTC, rwd...@gmail.com wrote:
    Does anyone know a method under CP/M 3 of determining the first directory entry for files in a directory, based on only searching the directory block, and not needing to cross refer to other directory entries?

    Under CP/M 2 the first directory entry of a file was identified as having extent number zero. This does not apply under CP/M 3.

    This method is used in the old Andrew Johnson Laird "FIND" program.

    Currently to write a program that shows files across all drives and users I have to use search-first, search-next and set-user bdos calls which is a much slower method.
    Under both CP/M 2 and 3, you should AND the extent number with the inverse of the extent mask from the DPB. You should also check that directory byte S2 (offset 0Eh) is zero.

    --
    John Elliott

    Thank you John , I shall give that a go.
    Richard

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)