home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v7 / text0071.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  3.4 KB

  1. From: cbosgd!cbosgd.ATT.COM!mark@ucbvax.berkeley.edu (Mark Horton)
  2. Date: Sun, 19 Oct 86 23:11:35 edt
  3. Organization: AT&T Medical Information Systems, Columbus
  4.  
  5. >If a conforming system may be case sensitive or case insensitive,
  6. >then a lot of programs won't be portable.  Ignore for the moment
  7. >all existing UNIX code and consider new program development.  I
  8. >believe that programmers on one kind of system won't bother
  9. >with the library routines that are used to compare and/or convert
  10. >mixed-case names to monocase.  It doesn't matter what people "ought"
  11. >to do.  A well-known example of this effect is 4.2BSD.  The source
  12. >code is full of variables that should be declared "long" but --
  13. >since on the VAX "long" and "int" are identical -- are not.  In the
  14. >same way, optional case sensitivity will spawn code that only runs
  15. >correctly in the environment where it was written.
  16. >
  17. >Therefore, I believe that case sensitivity must be retained, and
  18. >it should not be made optional.
  19.  
  20. I'm sorry, but I don't buy this argument.  It seems to be based on
  21. the assumption that case insensitivity will be implemented by the
  22. use of subroutines for case-insensitive operations, with a different
  23. user interface from that available today.  I think such an implementation
  24. is silly, even if other operating systems may do it that way.
  25.  
  26. I'm talking about file names only.  I do not advocate even considering
  27. making all of the user interfaces in UNIX case insensitive.  While it
  28. might have once been a good idea to design them that way, I feel it's
  29. far too late for someone to decree that all the upper and lower case
  30. keys in, say, vi must be equivalent.
  31.  
  32. I think it's a given that existing code won't be rewritten to use new
  33. interfaces, even if we come up with a wonderful way to do it.  Vi still
  34. uses raw terminfo, even through curses would have been much easier and
  35. better.  Also, there are lots of binaries out there that can't even be
  36. recompiled.  Any solution to this problem must be in the kernel, or possibly
  37. in libc underneath such subroutines as open, unlink, and chmod, (if you
  38. have shared libraries or full source to recompile) or it won't work all
  39. the time.
  40.  
  41. The obvious implementation is that the code in the kernel, when mapping a
  42. filename to an inode number, to do a case-insensitive comparison when
  43. checking each filename element in a directory.  This would be pretty
  44. simple to add, although issues such as speed and international variations
  45. would probably require a clever case-insensitive comparison, possibly
  46. using a country-specific case mapping table with some flags or other
  47. hacks to deal with single-multiple glyph mappings like SS to ess-tset.
  48. There might even be a performance GAIN if creation of a directory entry
  49. including calculating an appropriate hash function which is also stored
  50. in the directory and used for initial comparisons.
  51.  
  52. I see no need to map everything to lower case when creating the directory
  53. entry.  Let the entries be in mixed case; this allows more readable names.
  54. I don't know what to do about sorting (e.g. in the shell or ls) - it might
  55. be case sensitive or insensitive sorting, and good arguments can probably
  56. be made for both.
  57.  
  58. The behavior I'm concerned about is that, if the user types, say, "mail"
  59. and there's a command "Mail" in the search path, it should still work.
  60. If the file "FooBar" exists and the user cats "foobar", because somebody
  61. read that name over the phone, it should find it.
  62.  
  63.     Mark
  64.  
  65. Volume-Number: Volume 7, Number 72
  66.  
  67.