home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / A-R / LOADND12.LBR / LOADND.AZG / LOADND.ALÇ
Text File  |  2000-06-30  |  3KB  |  88 lines

  1. Program Name: LOADND.COM
  2.  
  3. Author: Al Hawley, Znode #2, (213) 670-9465 (modem)
  4.  
  5. Program purpose: In a system with more than one drive, changing
  6. a disk will very likely mean that a new NDR module must be loaded
  7. in order for PWD to show the correct directory names. The only 
  8. solution to date (to my knowledge) is to prepare an NDR file for
  9. each case with MKDIR. Obviously, in view of the number of possible
  10. combinations becomes very large: the number is a combinatorial
  11. function of the number of drives and number of disks with unique
  12. directories. The solution proposed is in two parts. 1) Place an
  13. NDR format file on each disk. The file would contain only the directory
  14. names unique to the disk on which it resides. 2) Use this program
  15. to merge the data from the DISK NDR file with that from the data
  16. in ZCPR3 Named Directory Buffer. The algorithm for merging must allow
  17. for handling of potentially duplicate names and for the possibility
  18. of overflow of the NDR buffer.
  19.  
  20. Invocation syntax:
  21.  
  22.     LOADND [DU:!DIR:][<FN>][.<FT>]       ( ! = EXCLUSIVE OR)
  23.  
  24. where the default values are current DU, FN=DISK, FT=NDR
  25.  
  26. Algorithm for LOADND:
  27.  
  28. Initial data:    current DU from operating system
  29.         default FN.FT in local FCB
  30.         target D, U, FN, FT from command tail
  31.         location & size of resident NDR from Z3ENV
  32.  
  33. 1)  Copy directory data from ZCPR3 Named Directory Buffer to ndrbuf:
  34.  
  35. 2)  Read directory data from target disk into dskbuf:
  36.  
  37. 3)  Replace all Drive specifications in dskbuf to D
  38.  
  39. 4)  Delete all records in ndrbuf whose drive desigation is D
  40.  
  41. 5)  Count the total number of directory name entries in dskbuf
  42.     and ndrbuf.
  43.  
  44. 6)  For each dir name in dskbuf, search for duplicates,
  45.     recording pointers to each duplicate pair in a table,
  46.     ignoring the case where the pointers are identical.
  47.  
  48. 7)  If no duplicates found, go to step 8.
  49.  
  50.     [resolve duplicate names using one or more of a,b,c]
  51.     a) delete the entry with lowest priority if number of
  52.     entries > Z3NDIRS. Decrement number of entries.
  53.  
  54.     b) modify the name with lowest priority by appending
  55.     to or replacing the last char with a character
  56.     then repeating step 5 and changing characters until
  57.     the duplication vanishes.
  58.  
  59.     c) present the duplicates on the screen for operator
  60.     resolution by renaming and/or deletion. Keep number
  61.     of entries correct.
  62.  
  63.     d) do nothing. Duplicates don't hurt anything, but the
  64.     system will only find the first one!
  65.  
  66. 8)  IF (number of entries > Z3NDIRS from Z3ENV)
  67.  
  68.         [resolve the problem: which names to delete?]
  69.     alternatives:
  70.  
  71.     a) Screen presentation for operator choice. Don't
  72.     let him exit (except for abort) until number of entries
  73.     <= Z3NDIRS.
  74.  
  75.     b) Arbitrarily delete entries from D drive records, starting
  76.     with user #31 down to 0 until size is reduced to Z3NDIRS
  77.  
  78.     c) Do nothing. Abort the operation, since it can't be done.
  79.  
  80.     ELSE
  81.     Merge dskbuf & ndrbuf.
  82.     ENDIF
  83.  
  84. 9) Initialize Z3NDIR, then copy the merged directory name record
  85.     list to it.
  86.  
  87. 10) Done. Restore original drive & user and exit.
  88.