Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!asuvax!mcdphx!mcdchg!ddsw1!andyross From: andyross@ddsw1.MCS.COM (Andrew Rossmann) Newsgroups: comp.lang.pascal Subject: Re: Reading a directory from Turbo. Message-ID: <1989Jul29.011656.280@ddsw1.MCS.COM> Date: 29 Jul 89 01:16:56 GMT References: <9559@xanth.cs.odu.edu> <563@infohh.rmi.de> Reply-To: andyross@ddsw1.MCS.COM (Andrew Rossmann) Organization: Macro Computer Solutions, Inc. - Mundelein, IL Lines: 31 In article <563@infohh.rmi.de> natec@infohh.rmi.de (NATEC Institut GmbH) writes: >Most simple solution is perhaps: > >Program Temp; >{$M $4000, 0, 0} >uses Dos; >begin > Exec('C:\COMMAND.COM','/C DIR >TEMPFILE'); >end. > >...read that TEMPFILE afterwards. > >Dr Gerd C Schmerse | UUCP: natec@infohh.rmi.de | ___ A more correct version would be: Program test; {$M 1024,0,0} Uses Dos; begin SwapVectors; ExecGetEnv('COMSPEC'), '/C DIR > TEMPFILE'); SwapVectors end. Not EVERYONE puts COMMAND.COM in the root directory. Many people prefer to have it elsewhere. The above will only work under TP 5 and 5.5. The GetEnv function was not in TP3 or 4. andyross@ddsw1.MCS.COM