Board index » delphi » FILES line in CONFIG.SYS, CONFIG.NT

FILES line in CONFIG.SYS, CONFIG.NT

Does anyone know if there's a way to set the equivalent FILES setting
inside a BP 7.01 program?

Example, I do not want to set FILES=120 in CONFIG.SYS or eqivalent but
would like the program to set this above the default for DOS.

Any help would be most appreciated.

Cheers.

Grant Seton
sound_no...@compuserve.com

 

Re:FILES line in CONFIG.SYS, CONFIG.NT


Quote
>Subject: FILES line in CONFIG.SYS, CONFIG.NT
>From: "SOUND NOETZ" <4ra...@soundnoetz.co.nz>
>Date: Thu, Nov 20, 1997 19:04 EST
>Message-id: <01bcf611$25653d40$283461cb@p75>

>Does anyone know if there's a way to set the equivalent FILES setting
>inside a BP 7.01 program?

>Example, I do not want to set FILES=120 in CONFIG.SYS or eqivalent but
>would like the program to set this above the default for DOS.

I don't think you can do that in DOS.  The maximum number of files that can be
opened by a process is set by the FILES = in CONFIG.SYS.  You can only expand
the process's own file table from the default of 20 to the maximum.

Why would you want to open 120 files at once anyway?!?

Quote
>Any help would be most appreciated.

>Cheers.

>Grant Seton
>sound_no...@compuserve.com

Re:FILES line in CONFIG.SYS, CONFIG.NT


More than one application open at once, semaphore files in a multi-user
environment.  The number needed can soon add up.

Grant Seton
sound_no...@compuserve.com

Re:FILES line in CONFIG.SYS, CONFIG.NT


"SOUND NOETZ" <4ra...@soundnoetz.co.nz> asked:

Quote
>>Does anyone know if there's a way to set the equivalent FILES setting
>>inside a BP 7.01 program?

>>Example, I do not want to set FILES=120 in CONFIG.SYS or eqivalent but
>>would like the program to set this above the default for DOS.

cbongc...@aol.com (CBongChan) replied:

Quote
>I don't think you can do that in DOS.  The maximum number of files that can be
>opened by a process is set by the FILES = in CONFIG.SYS.  You can only expand
>the process's own file table from the default of 20 to the maximum.

>Why would you want to open 120 files at once anyway?!?

rdon...@southeast.net (R.E.Donais) replied:
Ever work with a relational database where each table and index is a
separate file?  

Since CBongChan's reply contradicts itself, I guess its best we do a
quick review --

The files statement in config.sys defines the maximum number of files
that can be opened by _all_ processes.  By default, DOS provides for
no more than 20 handles per process.  Five of the 20 available handles
are assigned to default devices when a process is started -- stdin,
stdout, stderr, stdaux, stdprn.

The answer to SOUND NOETZ question is -- yes, a process can  increase
the size of the DOS file table to a maximum 255 entries even if the
config.sys entry stated FILES=20.  This is done automatically by some
xBase compilers like Clipper.  

The bad news is that the TP implementation isn't as easy as the
answer.  I am not aware of any, but you might want to check garbo and
simtel sites for existing solutions before you invest a lot of work.

If you can't find a ready made solution, suggest you get a copy of
Undocumented DOS and read the chapter on the DOS File System which
will provide all the information you need to know about such things as
the DOS List of Lists, System File Tables (SFTs), Job File Table
(JFT), etc.  I can't remember where or when, but I've done it before.
With my luck it was with TP 3.0 -- at least that would explain why I
can't locate the code. ;-(

    ...red

--
Support the anti-Spam amendment
  Join at http://www.cauce.org/

Re:FILES line in CONFIG.SYS, CONFIG.NT


Hi Grant

Quote
> Does anyone know if there's a way to set the equivalent FILES setting
> inside a BP 7.01 program?

        You can easily expand the number of files allowed to
open by program. I have used example from SWAG archive which is for
protected mode but is easy to convert to real mode.

Procedure DPMIExtendHandles;
Const
     Handles = 255; (* added *)
Type
    DosMemRec = record
      Sele, Segm : Word;
    end;
Var
  OldTable : Pointer;
  OldSize : Word;
  NewTable : Pointer;
  DosMem : DosMemRec;
begin

  If AllocDosMem(16, DosMem.Segm, DosMem.Sele) <> 0 then
   Halt(255);
  NewTable := Ptr(DosMem.Sele, 0);(*1*)
  FillChar(NewTable^, Handles, $FF);(*1*)
      {Copy old table to new. Assume old table in PrefixSeg}
  OldTable := Ptr(PrefixSeg, MemW[PrefixSeg:$34]);
  OldSize := Mem[PrefixSeg:$32];
  move(OldTable^, NewTable^, OldSize);

      {Set new handle table size and pointer}
  Mem[PrefixSeg:$32] := Handles;
  MemW[PrefixSeg:$34] := 0;
  MemW[PrefixSeg:$36] := DosMem.Segm;
end;

        Simply call DPMIExtendHandles in Your program startup and
You can open 255 files in Your program. For more information You should
see SWAG collection.

Sincerely Raul Rebane

Re:FILES line in CONFIG.SYS, CONFIG.NT


Thanks.

Grant Seton
sound_no...@compuserve.com

Other Threads