XtFilePredicate man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

XtFilePredicate()					     XtFilePredicate()

Name
  XtFilePredicate - interface definition for a filename evaluation proce‐
  dure.

Synopsis
  typedef Boolean (*XtFilePredicate)(String);
	 String filename;

Inputs
  filename  Specifies a potential filename.

Returns
  True if filename is acceptable; False otherwise.

Description
  An XtFilePredicate is specified in  calls  to	 XtResolvePathname()  and
  XtFindFile(),	 and  is  called to judge filenames found by those proce‐
  dures.  If the string is appropriate for the intended use (if it  names
  a  readable  file,  for example) then the XtFilePredicate should return
  True; otherwise it should return False.

Example
  The default predicate used by XtResolvePathname() and XtFindFile() sim‐
  ply tests that the specified filename exists, is readable, and is not a
  directory.  This default  procedure  is  shown  below.   Note	 that  it
  attempts to handle some operating system dependencies.

     static Boolean TestFile(path)
	 String path;
     {
     #ifdef VMS
	 return TRUE;	     /* Who knows what to do here? */
     #else
	 struct stat status;

	 return (access(path, R_OK) == 0 &&	     /* exists and is readable */
		 stat(path, &status) == 0 &&	     /* get the status */
     #ifndef X_NOT_POSIX
		 S_ISDIR(status.st_mode) == 0);	     /* not a directory */
     #else
		 (status.st_mode & S_IFDIR) == 0);   /* not a directory */
     #endif /* X_NOT_POSIX else */
     #endif /* VMS */
     }

See Also
  XtFindFile(1), XtResolvePathname(1).

Xt - File Searching					     XtFilePredicate()
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net