Path: utzoo!attcan!uunet!peregrine!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!sun-barr!newstop!sun!amdcad!dgcad!dg-rtp!hunt From: hunt@dg-rtp.rtp.dg.com (Greg Hunt) Newsgroups: comp.unix.questions Subject: Re: Unix C routines Message-ID: <1990Dec5.153414.19109@dg-rtp.dg.com> Date: 5 Dec 90 15:34:14 GMT References: <1990Dec5.051318.22071@metro.ucc.su.OZ.AU> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: hunt@dg-rtp.rtp.dg.com Organization: Data General Corp., Research Triangle Park, NC Lines: 27 In article <1990Dec5.051318.22071@metro.ucc.su.OZ.AU>, andrew@ee.su.oz.au (Andrew Ho) writes: > > I am writing an application for Unix X-window > which requires the following routines : > > (1) a routine that can return the full path > string of the current directory > > (2) another routine to return all the file > names in the current directory > > Are there any Unix built-in system calls to do so ? There are C library calls that can do want you need: Try getwd or getcwd to get the pathname of the current directory. Try opendir, readir, and closedir to iteratively get all the names of the files in a directory. Of course, you'll need to check that your C libraries actually implement these calls. Enjoy! -- Greg Hunt Internet: hunt@dg-rtp.rtp.dg.com DG/UX Kernel Development UUCP: {world}!mcnc!rti!dg-rtp!hunt Data General Corporation Research Triangle Park, NC, USA These opinions are mine, not DG's.