home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / DOS_HELP / SHARE6.ZIP / SHARE2.TXT < prev   
Encoding:
Text File  |  1991-02-14  |  4.8 KB  |  73 lines

  1. During the past week there has been more rumors and rumblings about
  2. the DOS share program. Here is some information and comments which may
  3. clarify its use and function..
  4. SHARE performs two somewhat related functions. It is called SHARE because
  5. it handles file sharing in DOS based networks. It also provides support for
  6. large hard drives. Why are these functions so closely related?
  7. In DOS versions before 2.0 (when file handles were introduced) it was the
  8. application software's responsibility to maintain an area of memory for file
  9. I/O (i.e. FCB [file control block]). Unfortunately, if the application 
  10. maintains complete control of the FCB it becomes difficult for DOS to
  11. change or implement new features (like device redirection) so Microsoft
  12. decided that THEY should have control of all internal file structures. With
  13. that, file handles accessed through strictly controlled function calls
  14. were born.
  15. However, what to do about all those old programs that used internal FCBs?
  16. Well, Microsoft continued to support the old method of file I/O, continually
  17. warning developers that the new file handle technique was the STRONGLY
  18. RECCOMENDED method approach in future software. This situation was not too
  19. much of a problem until DOS 3.0 tried to implement file sharing and locking.
  20. Microsoft found it virtually impossible to share files when the FCBs were
  21. being stored somewhere in the application software, so bad was the situation
  22. in testing that Microsoft dropped file sharing from the OS in 3.0 and
  23. implemented a major "patch" in DOS 3.1 with the SHARE command. Basically,
  24. SHARE achieves file sharing with old FCB based programs by creating a seperate
  25. FCB internal to DOS with extended information and using the SHARE FCB to
  26. correctly share files and lock records. SHARE only creates an internal FCB
  27. if the application uses FCBs on a network. However, two FCBs will be in use
  28. where only one was before so more will be needed in a network environment.
  29. Programs which use file handles DO NOT apply at all to this discussion.
  30. (SHARE does support file handle sharing, but was not originally intended to)
  31. There are reports that SHARE creates or uses FCBs when it does not have to,
  32. but these claims are not true. However, there is a slight chance that DOS
  33. will create an internal FCB and use it temporarily even with modern file I/O
  34. techniqiues. I believe this is true but is not related to SHARE or networks.
  35. Okay, enough about SHARE in file sharing situations. What about its need in
  36. large partitions?
  37. It just so happens that the original FCB devised for DOS 1.0 had an internal
  38. pointer limitation of 32mb. That is, the internal pointer for the current
  39. file position in an old FCB could only address places below 32mb. When a
  40. portion of a file was being accessed beyond the boundary DOS would not report
  41. an error but just roll over the pointer to point to an incorrect place in the
  42. first 32mb area. Subsequent reads or writes promptly and blindly corrupted
  43. the hard drive! Oh no..
  44. Fortunately, the solution to the blind pointer problem was for DOS to take
  45. control of the FCBs which SHARE was already doing for unrelated reasons.
  46. Microsoft used the functionality of SHARE to overcome this pointer rollover
  47. problem in the extended internal FCB created by SHARE. So even in non network
  48. computers with large hard drives, SHARE creates internal FCBs for programs
  49. that require them. That is how the two SHARE functions are related.
  50.  
  51. You should NEVER ignore the SHARE warning in an operating computer regardless
  52. of the status of the network. Myself and many of my associates have ignored
  53. this message when restoring files or installing LANtastic on brand new
  54. systems with impunity. (DOS COPY and XCOPY don't use FCBs) However, I now
  55. make sure to run it whenever it is requested.
  56. Incidentally, Microsoft thought it was SO IMPORTANT to run SHARE that if you
  57. fail to put SHARE in your CONFIG.SYS or AUTOEXEC.BAT, DOS will STILL make
  58. an attempt to search the root directory of the boot drive, and if the SHARE
  59. program happens to be residing there will LOAD IT! (Note that it will do 
  60. this with any program in the root that is called SHARE.EXE if SHARE is not
  61. run by the previous two means.) In addition, some versions of DOS 4.01 and
  62. below ignore SHARE command line parameters (the /F and /L stuff) if SHARE is
  63. run from the command prompt or AUTOEXEC.BAT. So put your SHARE in the 
  64. CONFIG.SYS file for proper instalation.
  65. I hope this was enlightening and helpful. While I believe the information
  66. contained in this document to be true, I am only a harried human being. I
  67. accept no responsibility for the results of the use of this information. I 
  68. also do not believe that any information contained here violates any IBM or
  69. Microsoft non-disclosure agreement. Thanks a million to the midnight guys at
  70. Lotus Development and Mr. Mike R. Sofft.
  71.  
  72. Tom Filliman, Fillimerica Incorporated...
  73.