


     nftw(GABI.os/genuRelease 1.3 (UniSoft Group Lnftw(GABI.os/genuts)



     NAME
	  GABI.os/genuts/nftw -	walk a file tree.

     DESCRIPTION
	  Nftw tests the nftw()	subroutine call	interface for
	  conformance to the SVID3 definition.	Page:ftw(BA_LIB)

     TESTS
     Compliance
	  1    A call to nftw(path,fn,depth,flags) recursively
	       descends	the directory hierarchy	rooted in path until
	       it has traversed	the whole tree,	calling	the function
	       fn for each object in the directory tree, and return
	       zero.

	  2    When flags contains FTW_PHYS, then a call to
	       nftw(path,fn,depth,flags) does not follow symbolic
	       links.

	  3    When flags does not contain FTW_PHYS, then a call to
	       nftw(path,fn,depth,flags) follows symbolic links	except
	       that it does not	walk down any path that	crosses
	       itself.

	  4    When flags contains FTW_MOUNT, then a call to
	       nftw(path,fn,depth,flags) does not cross	a mount	point.

	  5    When flags does not contain FTW_MOUNT, then a call to
	       nftw(path,fn,depth,flags) crosses mount points as
	       necessary.

	  6    When flags contains FTW_DEPTH, then a call to
	       nftw(path,fn,depth,flags) visits	all descendents	before
	       visiting	the directory itself.

	  7    When flags does not contain FTW_DEPTH, then a call to
	       nftw(path,fn,depth,flags) visits	a directory before
	       visiting	its descendants.

	  8    When flags contains FTW_CHDIR, then a call to
	       nftw(path,fn,depth,flags) changes to each directory
	       before reading it.

	  9    A call to nftw(path,fn,depth,flags) shall pass:
	       the path-name of	the current object, which is a NULL
	       terminated string including the root name specified by
	       path, as	the first argument of the function fn;
	       a pointer to a stat structure, containing information
	       about the current object, as the	second argument	of the
	       function	fn;
	       an integer as the third argument	of the function, which
	       shall be:



     Page 1					    (printed 2/21/103)






     nftw(GABI.os/genuRelease 1.3 (UniSoft Group Lnftw(GABI.os/genuts)



		    i. FTW_F if	the object is a	file;
		    ii.	FTW_D if the object is a directory and
		    subdirectories have	not been visited;
		    iii. FTW_DP	if the object is a directory and
		    subdirectories have	been visited;
		    iv FTW_SL if the object is a symbolic link;
		    v. FTW_DNR if the object is	a directory that
		    cannot be read;
		    vi.	FTW_NS if a stat() could not be	carried	out on
		    the	object.
	       a structure which contains the offset into the pathname
	       of the object and the depth relative to the root	of the
	       walk as the fourth argument of the function.

	  10   On a call to nftw(path,fn,depth,flags) when the integer
	       passed to the function fn is FTW_DNR then the
	       descendants of the directory shall not be processed.

	  11   A call to nftw(path,fn,depth,flags) shall close any
	       file descriptors	or directory streams used to traverse
	       the directory tree.

	  12   On a call to nftw(path,fn,depth,flags) depth is the
	       maximum number of file descriptors or directory streams
	       that shall be used.

	  13   A call to nftw(path,fn,depth,flags) when	the function
	       fn returns a non-zero value shall stop and return the
	       return value of fn.

     Deviance
	  14   ENAMETOOLONG in errno and return	-1 on a	call to
	       nftw(path,fn,depth,flags) if the	length of path exceeds
	       pathconf(path,_PC_PATH_MAX).

	  15   If a call to pathconf(_PC_NO_TRUNC) return other	than
	       -1 then ENAMETOOLONG in errno and return	-1 on a	call
	       to nftw(path,fn,depth,flags) if a component of path
	       exceeds pathconf(path,_PC_NAME_MAX).

	  16   ENOENT in errno and return -1 on	a call to
	       nftw(path,fn,depth,flags) if path points	to a file
	       which does not exist.

	  17   ENOENT in errno and return -1 on	a call to
	       nftw(path,fn,depth,flags) if path is an empty string.

	  18   ENOTDIR in errno	and return -1 on a call	to
	       nftw(path,fn,depth,flags) if path is not	a directory.

     OUTPUTS
     Tests:



     Page 2					    (printed 2/21/103)






     nftw(GABI.os/genuRelease 1.3 (UniSoft Group Lnftw(GABI.os/genuts)



	  1

     PROBLEMS
	  The term "crosses itself" is poorly defined. Need to clarify
	  what this means.

     RELEASE
	  1.7 (8/1/92)















































     Page 3					    (printed 2/21/103)



