home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / aux / 3398 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  2.2 KB

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!cbfsb!att-out!rutgers!cmcl2!panix!spencer
  2. From: spencer@panix.com (David Spencer)
  3. Newsgroups: comp.unix.aux
  4. Subject: directory diff broken?
  5. Message-ID: <1992Sep9.131546.20638@panix.com>
  6. Date: 9 Sep 92 13:15:46 GMT
  7. Organization: PANIX Public Access Unix, NYC
  8. Lines: 63
  9.  
  10. If I diff two directories, diff will stop after the first file that
  11. differs from its counterpart, rather than diffing each file against
  12. its counterpart. E.g.
  13.  
  14.    $ mkdir fgrep
  15.    $ cp /usr/local/src/fgrep/* fgrep
  16.    $ cd fgrep
  17.    $ ls -C
  18.    Makefile   fgrep.c    kwset.h    obstack.h  std.h
  19.    README     kwset.c    obstack.c  std.c      unix.h
  20.    $ for i in *.c; do echo "test $i">>$i; done
  21.    $ diff . /usr/local/src/fgrep
  22.    diff ./fgrep.c /usr/local/src/fgrep/fgrep.c
  23.    628d627
  24.    < test fgrep.c
  25.  
  26. [What about kwset.c, obstack.c and std.c?]
  27.  
  28. On the other hand, diff -c works:
  29.  
  30.    $ diff -c . /usr/local/src/fgrep
  31.    diff -c ./fgrep.c /usr/local/src/fgrep/fgrep.c
  32.    *** ./fgrep.c    Wed Sep  9 08:19:36 1992
  33.    --- /usr/local/src/fgrep/fgrep.c    Wed Mar  7 12:33:53 1990
  34.    ***************
  35.    *** 625,628
  36.  
  37.        exit(error_seen ? 2 : status);
  38.      }
  39.    - test fgrep.c
  40.  
  41.    --- 625,627 -----
  42.  
  43.        exit(error_seen ? 2 : status);
  44.      }
  45.    diff -c ./kwset.c /usr/local/src/fgrep/kwset.c
  46.    *** ./kwset.c    Wed Sep  9 08:19:36 1992
  47.    --- /usr/local/src/fgrep/kwset.c    Wed Mar  7 12:29:13 1990
  48.    ***************
  49.    *** 607,610
  50.        obstack_free(&kwset->obstack, (PTR) NULL);
  51.        free((PTR) kws);
  52.      }
  53.    - test kwset.c
  54.  
  55.    --- 607,609 -----
  56.        obstack_free(&kwset->obstack, (PTR) NULL);
  57.        free((PTR) kws);
  58.      }
  59.    [differences in obstack.c and std.c omitted]
  60.  
  61. On large directories, diff -c sometimes quits after a few files. On
  62. directories with subdirectories, diff -r (with or without -c) will
  63. often stop printing after a few files, but not return. ps reveals
  64. several children.
  65.  
  66. I get the same results on my machine at home and on panix. It's not a
  67. practical problem; Gnu diff works fine. I can also work around it by
  68. using find to call diff on each file-pair.
  69.  
  70. Anybody else noticed this?
  71.  
  72. dhs    spencer@panix.com
  73.