home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / lower.icn < prev    next >
Text File  |  2000-07-29  |  868b  |  37 lines

  1. ############################################################################
  2. #
  3. #    File:     lower.icn
  4. #
  5. #    Subject:  Program to map file names to lowercase
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     January 6, 1995
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program maps the names of all files in the current directory to
  18. #  lowercase.
  19. #
  20. ############################################################################
  21. #
  22. #  Requires:   UNIX 
  23. #
  24. ############################################################################
  25.  
  26. procedure main()
  27.    local input, old, new
  28.  
  29.    input := open("ls", "p")
  30.  
  31.    while old := read(input) do {
  32.       new := map(old)
  33.       if new ~== old then rename(old, new)
  34.       }
  35.  
  36. end
  37.