File Control Block: Difference between revisions

Content deleted Content added
Undid revision 608276963 by AnonMoos (talk) Found a book which happens to discuss the various FCB limits and workarounds downto the implementation details, thereby backing up previous contribution.
Added another source also mentioning sub-directories
Line 30:
 
==Usage==
In CP/M, [[86-DOS]] and [[PC DOS]] 1.x/[[MS-DOS]] 1.xx, the FCB was the only method of accessing files. When, with MS-DOS 2, preparations were made to support multiple processes or users,<ref name="Duncan_1988_MS-DOS_Encyclopedia"/><ref name="Chappell_1994_DOS-Internals"/> use other filesystems<ref name="Duncan_1988_MS-DOS_Encyclopedia"/><ref name="Chappell_1994_DOS-Internals"/> than FAT or to share files<ref name="Chappell_1994_DOS-Internals"/> over networks in the future, FCBs were felt to be too small to handle the extra data required for such features<ref name="Chappell_1994_DOS-Internals"/> and therefore FCBs were seen as inadequate for various future expansion paths.<ref name="Duncan_1988_MS-DOS_Encyclopedia"/> Also, they didn't provide a field to specify sub-directories.<ref name="Duncan_1988_MS-DOS_Encyclopedia"/> Exposing file system related data to user-space was also seen as a security risk.<ref name="Chappell_1994_DOS-Internals"/> FCBs were thus superseded by [[file handle]]s, as used on [[UNIX]] and its derivatives.<ref name="Duncan_1988_MS-DOS_Encyclopedia"/> File handles are simply consecutive integer numbers associated with specific open files.
 
If a program uses the newer file handle API to open a file, the operating system will manage its internal data structure associated with that file in its own memory area. This has the great advantage that these structures can grow in size in later operating system versions without breaking compatibility with application programs; its disadvantage is that, given the rather simplistic [[memory management]] of DOS, space for as many of these structures as the most "file-hungry" program is likely to use has to be reserved at boot time and cannot be used for any other purpose while the computer is running. Such memory reservation is done using the [[FILES (CONFIG.SYS directive)|FILES]]= directive in the [[CONFIG.SYS]] file. This problem does not occur with FCBs in DOS 1 or in CP/M, since the operating system stores all that it needs to know about an open file inside the FCB and thus does not need to use any per-file memory in operating system memory space. When using FCBs in MS-DOS 2 or later, the FCBs are dummies that store references to the actual file management data in operating system memory. Because of this, the number of FCBs which can be kept open at once in DOS 2 or higher is limited as well, usually to 4; using the [[FCBS (CONFIG.SYS directive)|FCBS]]= directive in the CONFIG.SYS file, it may be increased beyond that number if necessary. Under [[DR-DOS]], both FILES and FCBS come from the same internal pool of available handles structures and are assigned dynamically as needed.<ref name="Paul_1997_NWDOSTIP"/>
Line 40:
== References ==
<references><ref name="Chappell_1994_DOS-Internals">Geoff Chappell (1994). ''DOS Internals''. Addison Wesley. ISBN 0-201-60835-9, ISBN 978-0-201-60835-9.</ref>
<ref name="Duncan_1988_MS-DOS_Encyclopedia">Ray Duncan (1988). ''The MS-DOS Encyclopedia - version 1.0 through 3.2''. Microsoft Press. ISBN 1-55615-049-0.</ref><!-- While mostly based on DOS 3.2, this book has an appendix covering changes introducted with DOS 3.3 -->
<ref name="Paul_1997_NWDOSTIP">{{cite book | title = NWDOS-TIPs &mdash; Tips &amp; Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds | work= MPDOSTIP | author = Matthias Paul | date = 1997-07-30 | edition = edition 3, release 157 | language= German | format = e-book | url = http://www.antonis.de/dos/dos-tuts/mpdostip/html/nwdostip.htm | accessdate = 2012-01-11}} NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.</ref></references><references/>