Unix C routines

James Cummings james at dlss2.UUCP
Thu Dec 6 06:25:20 AEST 1990


In article <1990Dec5.051318.22071 at metro.ucc.su.OZ.AU> andrew at ee.su.oz.au (Andrew Ho) writes:
>
>Hi,
>
>  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
>
	System V 3.2.x -- getcwd()
	Berkeley 4.3   -- getwd()

>  (2) another routine to return all the file
>      names in the current directory
>
	Berkeley 4.3 -- use "<sys/dir.h> and <sys/types>"
			 the "opendir()" is used much like "fopen()"
			 and the "readdir()" call can be used to read
			 inode and file names into a struct of type DIR
			 until the readdir returns NULL.  Check the 
			 Programmer's reference.

	System V  -- similar to BSD, but you may have to investigate the
		       "dirent.h" header as well.

	Hope this helps.



More information about the Comp.unix.questions mailing list