home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / utils / bug / 1396 < prev    next >
Encoding:
Text File  |  1992-08-22  |  2.3 KB  |  55 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!eng.umd.edu!djm
  3. From: djm@eng.umd.edu (David J. MacKenzie)
  4. Subject: Re: GNU fileutils v3.2.3 alter pathnames by removing trailing slashes
  5. Message-ID: <199208220155.AA08779@frob.eng.umd.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. References: <9208141945.AA04108@cygnus.com>
  9. Distribution: gnu
  10. Date: Fri, 21 Aug 1992 17:55:32 GMT
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12. Lines: 41
  13.  
  14. > The file utilities (cp, mv, etc) eliminate some errors by always removing
  15. > trailing slashes from file names.
  16.  
  17. > My guess is that somebody tried using the GNU fileutils under "bash"
  18. > with filename completion, and had some minor problem because bash
  19. > inserts a / at the end of a path if the last part of the name is a
  20. > directory.
  21.  
  22. As you guessed, the behavior is intentional.  The problem is that the
  23. Unix rename system call -- and maybe others, I don't remember anymore
  24. -- returns an "Invalid argument" error if an argument ends in "/",
  25. presumably because that really means "/.", which you're not allowed to
  26. rename.
  27.  
  28. Not just bash -- filename completion in tcsh, ksh, bash, and zsh adds
  29. a "/" after directory names.  I and many others use filename
  30. completion quite often and it got to be very annoying to have to
  31. remember to constantly back up and delete the slashes.
  32.  
  33. So I made mv ignore slashes; then I made the other utilities do so
  34. also, for consistency (and because the output, for example of du, or
  35. cp, mv, or ln -v, looks nicer without the excess slashes).  I've never
  36. encountered problems from the slightly reduced error checking.  Maybe
  37. I don't make the right kind of typos.
  38.  
  39. >  (Some part of the fileutils probably assumed that there
  40. > would be no trailing slashes in names.)
  41. > The Unix kernel properly handles names containing multiple leading,
  42. > internal, and trailing slashes.
  43.  
  44. As noted above, this is not quite the case, at least in the DWIM sense.
  45.  
  46. > The fix is not indiscriminate bashing of trailing slashes, as
  47. > currently implemented.  The fix is to remove the generic truncation of
  48. > trailing slashes, then to fix whatever minor bugs prevent the use of
  49. > pathnames containing trailing slashes.
  50.  
  51. Fix everyone's shells, or everyone's kernels?  I don't offhand see a
  52. better solution than what the GNU utilities currently do.  But
  53. specific suggestions are welcome.
  54.  
  55.