home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff270.lzh / ColumnSet / ld < prev    next >
AmigaDOS Script File  |  1989-11-06  |  2KB  |  47 lines

  1. .KEY pathname,width,dirtag
  2. .DEF pathname ""
  3. .DEF width 77
  4. .DEF dirtag /
  5. .BRA {
  6. .KET }
  7. ; AmigaDOS script "ld" by Kent Paul Dolan
  8. ;
  9. ; Accepts a single parameter, the pathname of the directory to be listed.
  10. ; Produces a sorted directory with as many columns as will fit in a full
  11. ; width (77 character wide) Amiga bordered window, such as the one for
  12. ; the AmigaShell or, here, the "less" file display utility, and displays
  13. ; it using the PD "less" utility.  All work files are in "T:" and are
  14. ; deleted at the end of the script.  The "column_set" program is a small
  15. ; PD Modula-2 utility written by the author of this script.
  16. ;
  17. ; Create a single column listing of the files in <pathname>
  18. ;
  19. list > t:ld.1 {pathname} files lformat="%S"
  20. ;
  21. ; Add the directories to the listing, but flag them with a tag string to
  22. ; distinguish them from the files.
  23. ;
  24. list >> t:ld.1 {pathname} dirs lformat="%S{dirtag}"
  25. ;
  26. ; Sort the lot together.
  27. ;
  28. sort from t:ld.1 to t:ld.2
  29. ;
  30. ; Use my PD Modula-2 utility to rearrange the names into as many columns
  31. ; as will fit in a full sized window; "column_set" does one pass to
  32. ; size the file names looking for the longest name, and a second pass
  33. ; to create the output from the input.  Input is a file with one file or
  34. ; directory name per line, output is the same set of names set in columns.
  35. ;
  36. column_set -w {width} t:ld.2 t:ld.3 
  37. ;
  38. ; Use the PD "less" utility to put up a window in which the directory
  39. ; names may be scrolled up and down; if you don't have "less", replace
  40. ; it here with "more", the standard AmigaDOS text file display routine.
  41. ;
  42. less t:ld.3
  43. ;
  44. ; Clean up the work files.
  45. ;
  46. delete t:ld.1 t:ld.2 t:ld.3
  47.