🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.misc
Article #44

Re: Help finding contents of current directory.

#44
From: Tom Wheeley
Date: Fri, 22 Mar 1996 01:53
34 lines
2153 bytes
In article <4in24g$ota@airdmhor.gen.nz>
           gumboot@airdmhor.gen.nz "Simon Hosie" writes:

> Dale Hollon (hollon@gate.net) wrote:
> > I am trying to get a listing of the files in the current directory. I realize
>  I will have to use 
> > stat to determin wether it is a file or a directory.  But how do I find out
>  what's in the 
> > directory in the first place.
> 
> Tommi Ylikulju:
> > I use _dos_findfirst and _dos_findnext functions to find out a listing of
> > files in a specific directory. Check C documention for more info about  
> > those functions.
> 
>   Umm, they're very DOSish functions.. are there not UNIXish functions that
> do the same thing but are also supported by DOS compilers?

opendir, readdir and closedir

Similar to Findfirst and findnext under dos.

I doubt that you can use a construct directly accross unix/dos; you'll
probably need some #ifdefs  :|

Maybe DJGPP supports the unix functions as is?  I doubt it, seeing as it is
an OS call.  We can't expect DOS to be POSIX now, can we :)

.splitbung
-- 
* TQ 1.0 * The 'Just So Quotes'.
Artificial Intelligence: the art of making computers that behave like the 
ones in movies.
	-- Bill Bulko
Technical Details
Message-ID: <827459606snz@tsys.demon.co.uk>
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!tsys.demon.co.uk
References: <4ho68l$qhi@ruby.digisys.net> <4hrjt1$jpr@news.microsoft.com> <3149D3CC.7D67@gate.net> <4icvkb$ogn@pinta.kolumbus.fi> <4in24g$ota@airdmhor.gen.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!tsys.demon.co.uk
From: Tom Wheeley <tomw@tsys.demon.co.uk>
Newsgroups: comp.lang.basic.misc,comp.lang.basic.visual.misc,comp.lang.c,comp.lang.c++,comp.os.ms-windows.apps.comm,comp.os.ms-windows.apps.word-proc,comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools.mfc,comp.windows.misc
Subject: Re: Help finding contents of current directory.
Date: Fri, 22 Mar 96 01:53:26 GMT
Organization: City Zen FM
Message-ID: <827459606snz@tsys.demon.co.uk>
References: <4ho68l$qhi@ruby.digisys.net> <4hrjt1$jpr@news.microsoft.com> <3149D3CC.7D67@gate.net> <4icvkb$ogn@pinta.kolumbus.fi> <4in24g$ota@airdmhor.gen.nz>
Reply-To: tomw@tsys.demon.co.uk
X-NNTP-Posting-Host: tsys.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.30
X-Sig-By: Tomsystems Quote v1.2.  (c)1996 Tom Wheeley, tomw@tsys.demon.co.uk
X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!tsys.demon.co.uk