Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!crdgw1!sagittarius!dixon From: dixon@sagittarius.crd.ge.com (walt dixon) Newsgroups: comp.sys.ibm.pc Subject: Re: Retrieving the value of FILES=??? Keywords: Global File Handle Table Message-ID: <8571@crdgw1.crd.ge.com> Date: 14 Jun 90 21:00:09 GMT References: <605@digigw.digital.co.jp> <4057@jato.Jpl.Nasa.Gov> Sender: news@crdgw1.crd.ge.com Reply-To: dixon@sagittarius.crd.ge.com (walt dixon) Organization: General Electric Corp. R&D, Schenectady, NY Lines: 37 In article <4057@jato.Jpl.Nasa.Gov> Kaleb Keithley writes: >In article <605@digigw.digital.co.jp> gday@digigw.digital.co.jp > (Gordon Day) wr: >>I am confronted with the problem of finding out length of the global file >>handle table in DOS (>=3.3). I am aware of the following issues: >> >> [ much deleted ] >How about: (in psuedo-code) >#ifdef DOS > fopen ("/CONFIG.SYS", "r"); > fscanf (..., "FILES=", ...); > fscanf (..., value, ...); > fclose (...); >#else > other method appropriate for architecture >#end >Since all DOS machines have to have CONFIG.SYS in the root directory, it >would work for any DOS box. If the fopen fails, then assume the default. This technique should work in almost all cases. The parsing logic should be a little smarter because it is possible to "comment" out lines in CONFIG.SYS. Its also possible to grow the System File table after boot by linking a memory block to the existing chain. Finally as Kaleb notes there is the posibility that the open will fail. I still prefer traversing the SFT blocks. Walt Dixon {internet: dixon@crd.ge.com } {us mail: ge crd } { po box 8 } { schenectady, ny 12301 } {phone: 518-387-5798 (W) } { 518-875-6203 (H) } Walt Dixon dixon@crd.ge.com