garys@earth.cchem.berkeley.edu (Gary Shea) (09/09/89)
My first effort at an X utility is described below. I just put it in contrib on expo.lcs.mit.edu, and it is currently doing the rounds of comp.sources.x. Hope you find it interesting. Xf(1) is an X11R3 utility for generating lists of filenames on the standard output. The user calls xf(1X) and a directory is displayed in a new (user-positioned) window. From that window the user can bring up new windows on adjacent directories. Files may be 'selected' from the displayed windows; eventually the 'Done' button is pushed and the list of selected files (relative to the current directory) appears on stdout. Xf(1) is useful as a keyboard-replacement when selecting files to delete, copy, tar, etc.. Some examples of xf(1) usage are: 403 % rm `xf /data/x11r3/stuff` 404 % cp `xf ../xwatch` . 405 % foreach f (`xf /usr/man/man1`) ? troff -man $f | lpr -Plz -t ? end Xf(1) is written primarily in ANSI C, except for the Set widget (a corruption of the Athena List widget) which remains in the original pcc dialect. The code assumes the existence of the POSIX-standard directory-access routines (present on many modern workstations with recent OS releases ;^), and uses the getopt(1) routine to parse the (currently few) command line arguments. Getopt(1) and the POSIX directory-access routines are available from the comp.sources.unix archives. Xf(1) is not yet ICCCM compliant -- it does not specifically beg to use the keyboard, etc.. Soon... If you find bugs or have suggestions for improvement of the xf(1) program, please notify me and I will make appropriate changes in future releases of xf(1). Gary Shea Dep't of Computer Science, Univ. of Kansas garys@csvax.cs.ukans.edu garys@earth.cchem.berkeley.edu gary