v17i037: delete - MIT Athena delete/undelete programs, Patch13

Jonathan I. Kamens jik at pit-manager.MIT.EDU
Tue Mar 12 13:36:46 AEST 1991


Submitted-by: Jonathan I. Kamens <jik at Athena.MIT.EDU>
Posting-number: Volume 17, Issue 37
Archive-name: delete/patch13
Patch-To: delete: Volume 17, Issue 23-26

  This patch brings the "delete" package from patchlevel 12 to
patchlevel 13.  Use "patch -p0" in your delete source directory to
apply it.  However, before applying it, you should rename the file
"mit-copyright.h" in your source directory to "mit-copying.h"; this
change is to accomodate systems that are restricted to 14-character
filenames.

  This patch accomplishes the following:

1. I think I've finally got all of the RCS headers in sync, so after
   this patch, I shouldn't have to send out any more patches that
   change the RCS strings in files without changing anything else.

2. I've added a new compile-time configuration option, USE_BLOCKS.
   See the description in the Makefile and README files for more
   information.  When this option is enabled, delete is a little bit
   smarter about figuring out how much space files actually take up on
   the disk.

3. A new file, block-test.sh, is included to help determine whether or
   not to enable USE_BLOCKS.  This file should be created
   automatically by the patch.

4. I've added BUGS, BETA-TESTERS and ARCHIVE SITE sections to the
   README file  (please read them).

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710
----------------------------

*** /tmp/delete/PATCHLEVEL	Mon Mar 11 19:03:41 1991
--- PATCHLEVEL	Mon Mar 11 19:22:12 1991
***************
*** 1 ****
! 12
--- 1 ----
! 13
*** /tmp/delete/README	Mon Mar 11 20:08:03 1991
--- README	Mon Mar 11 20:07:35 1991
***************
*** 63,69 ****
--- 63,73 ----
     to you, then uncomment the variables starting with "AFS" and set
     them appropriately.
  
+ 6. See the comment in the Makefile about USE_BLOCKS.  If you do not
+    know whether or not you have st_blocks or if it represents 512-byte
+    blocks, run "make block-test" and you should be told what to do.
  
+ 
  			   COM_ERR LIBRARY
  
  In order to compile delete, you need to get your hands on the com_err
***************
*** 79,84 ****
--- 83,116 ----
  them separately from delete.
  
  
+ 				 BUGS
+ 
+ It is not clear to me that the USE_BLOCKS code is going to do the
+ right thing on all systems.  If you define USE_BLOCKS and discover
+ that lsdel, expunge or purge gives you bogus values for file sizes or
+ total amount of space, please let me know, because it will help me to
+ tighten up the code to work on a variety of different systems.
+ 
+ 
+ 		     I'M LOOKING FOR BETA-TESTERS
+ 
+ I try to make this package run on as many different platforms as
+ possible.  However, I do not have access to a large variety of
+ platforms, so I can't effectively test all of the changes I make.  I'm
+ therefore looking for people who are willing to beta-test changes
+ before I release them to the general public.  If you are interested in
+ doing this, please let me know.
+ 
+ 
+ 			     ARCHIVE SITE
+ 
+ The most recent version of the delete package and patches to get from
+ previous versions to the most recent version are archived on
+ pit-manager.mit.edu (18.72.1.58).  You can retrieve them via anonymous
+ ftp in the directory /pub/delete, or via mail-server (send a message
+ with the subject "help" to "mail-server at pit-manager.mit.edu").
+ 
+ 
  			     FINAL NOTES
  
  As usual, suggestions and bug fixes are always welcomed.
***************
*** 90,95 ****
  jik at Athena.MIT.EDU				Allston, MA  02134
  Office: 617-253-8085			      Home: 617-782-0710
  
! P.S. Please see the file "mit-copyright.h" for copying and
  redistribution information.  Copyright 1991 Massachusetts Institute of
  Technology.  All Rights Reserved.  Etc.
--- 122,127 ----
  jik at Athena.MIT.EDU				Allston, MA  02134
  Office: 617-253-8085			      Home: 617-782-0710
  
! P.S. Please see the file "mit-copying.h" for copying and
  redistribution information.  Copyright 1991 Massachusetts Institute of
  Technology.  All Rights Reserved.  Etc.
*** /tmp/delete/col.c	Mon Mar 11 19:03:43 1991
--- col.c	Mon Mar 11 19:12:29 1991
***************
*** 1,5 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/col.c,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
--- 1,5 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/col.c,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_col_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/col.c,v 1.7 90/06/06 19:05:56 jik Exp $";
  #endif
  
  /*
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_col_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/col.c,v 1.8 91/02/28 18:42:09 jik Exp $";
  #endif
  
  /*
***************
*** 31,37 ****
  #include "errors.h"
  #include "delete_errs.h"
  #include "col.h"
! #include "mit-copyright.h"
  
  
  static int calc_string_width(), calc_widths(), num_width();
--- 31,37 ----
  #include "errors.h"
  #include "delete_errs.h"
  #include "col.h"
! #include "mit-copying.h"
  
  
  static int calc_string_width(), calc_widths(), num_width();
*** /tmp/delete/col.h	Mon Mar 11 19:03:44 1991
--- col.h	Mon Mar 11 19:12:29 1991
***************
*** 1,5 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/col.h,v $
   * $Author: jik $
   *
   * This header file is part of a package including delete, undelete,
--- 1,5 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/col.h,v $
   * $Author: jik $
   *
   * This header file is part of a package including delete, undelete,
***************
*** 7,15 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  /*
   * DEF_COL_WIDTH: the column with to try to use if none is specified.
--- 7,15 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  /*
   * DEF_COL_WIDTH: the column with to try to use if none is specified.
*** /tmp/delete/delete.h	Mon Mar 11 19:03:45 1991
--- delete.h	Mon Mar 11 19:12:31 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/delete.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/delete.h,v 1.4 89/10/23 13:43:22 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete.h,v 1.5 91/02/28 18:42:22 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,14 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
! #include "mit-copyright.h"
--- 8,14 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
! #include "mit-copying.h"
*** /tmp/delete/delete_errs.et	Mon Mar 11 19:03:46 1991
--- delete_errs.et	Mon Mar 11 19:12:32 1991
***************
*** 1,11 ****
  #     Copyright 1988 Massachusetts Institute of Technology.
  #
  #     For copying and distribution information, see the file
! #     "mit-copyright.h".
  #
! #     $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/delete_errs.et,v $
  #     $Author: jik $
! #     $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/delete_errs.et,v 1.3 89/12/28 14:44:22 jik Exp $
  #
  
  	et	del
--- 1,11 ----
  #     Copyright 1988 Massachusetts Institute of Technology.
  #
  #     For copying and distribution information, see the file
! #     "mit-copying.h".
  #
! #     $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete_errs.et,v $
  #     $Author: jik $
! #     $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete_errs.et,v 1.4 91/02/28 18:42:24 jik Exp $
  #
  
  	et	del
*** /tmp/delete/directories.h	Mon Mar 11 19:03:46 1991
--- directories.h	Mon Mar 11 19:12:35 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/directories.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/directories.h,v 1.10 91/02/22 06:33:34 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/directories.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/directories.h,v 1.12 91/03/11 18:41:30 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
! #include "mit-copyright.h"
  
  typedef short Boolean;
  #define True			(Boolean) 1
--- 8,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
! #include "mit-copying.h"
  
  typedef short Boolean;
  #define True			(Boolean) 1
***************
*** 18,24 ****
  #define False			(Boolean) 0
  
  
! #define size_to_k(x)		((x) / 1024 + (((x) % 1024) ? 1 : 0))
  
  #define FOLLOW_LINKS		1
  #define DONT_FOLLOW_LINKS	0
--- 18,32 ----
  #define False			(Boolean) 0
  
  
! #ifdef USE_BLOCKS
! #define specs_to_space(x)	((x).st_blocks)
! #define space_to_k(x)		((x) / 2 + (((x) % 2) ? 1 : 0))
! #define specs_to_k(x)		space_to_k((x).st_blocks)
! #else
! #define specs_to_space(x)	((x).st_size)
! #define space_to_k(x)		((x) / 1024 + (((x) % 1024) ? 1 : 0))
! #define specs_to_k(x)		space_to_k((x).st_size)
! #endif
  
  #define FOLLOW_LINKS		1
  #define DONT_FOLLOW_LINKS	0
***************
*** 32,67 ****
       unsigned short st_mode;
       off_t st_size;
       time_t st_ctime;
! #ifdef notdef
!      /*
!       * I've tried, unsuccessfully, to figure out exactly what this
!       * field means and how I can use it.  Supposedly, it indicates
!       * the number of blocks the file actually occupies, i.e. the size
!       * of the file minus any holes in it there may be.  The question,
!       * however, is this: what's a "block?"
!       *
!       * At first, I thought that a block is as big as f_bsize returned
!       * by a statfs on the file.  But that doesn't prove to be the
!       * case, because my home directory in AFS has f_bsize of 8192,
!       * st_size of 8192, and st_blocks of 16 (!!), indicating that a
!       * block size of 512 bytes is being used.  Where does that size
!       * come from, and why isn't it consistent with the f_bsize
!       * retrieved from statfs?
!       *
!       * Until someone can answer these questions for me enough that
!       * I'm willing to trust the value in this field, I can't use it.
!       * Besides that, it doesn't even exist in the POSIX stat
!       * structure, so I'm not even sure it's worth trying to use it.
!       *
!       * Here's another dilemma: When I do a statfs on my home
!       * directory in AFS, it tells me that the f_bsize is 8192.  If
!       * that's the case, then when I create a one-character file in my
!       * home directory, my quota usage should go up by 8k.  But it
!       * doesn't, it goes up by just 1k.  Which means that the f_bsize
!       * I'm getting from statfs has nothing to do with the minimum
!       * block size of the filesystem.  So what *does* it have to do
!       * with?
!       */
       long st_blocks;
  #endif
  } mystat;
--- 40,46 ----
       unsigned short st_mode;
       off_t st_size;
       time_t st_ctime;
! #ifdef USE_BLOCKS
       long st_blocks;
  #endif
  } mystat;
*** /tmp/delete/errors.c	Mon Mar 11 19:03:47 1991
--- errors.c	Mon Mar 11 19:12:36 1991
***************
*** 7,23 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_errors_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/errors.c,v 1.3 90/11/12 02:28:28 jik Exp $";
  #endif
  
  #include <com_err.h>
  #include <stdio.h>
  #include "delete_errs.h"
! #include "mit-copyright.h"
  
  char *whoami;
  int error_reported = 1;
--- 7,23 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_errors_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/errors.c,v 1.4 91/02/28 18:42:40 jik Exp $";
  #endif
  
  #include <com_err.h>
  #include <stdio.h>
  #include "delete_errs.h"
! #include "mit-copying.h"
  
  char *whoami;
  int error_reported = 1;
*** /tmp/delete/errors.h	Mon Mar 11 19:03:48 1991
--- errors.h	Mon Mar 11 19:12:36 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/errors.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/errors.h,v 1.2 89/11/06 21:27:23 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/errors.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/errors.h,v 1.3 91/02/28 18:42:52 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  extern char *whoami;
  extern int error_reported;
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  extern char *whoami;
  extern int error_reported;
*** /tmp/delete/expunge.h	Mon Mar 11 19:03:48 1991
--- expunge.h	Mon Mar 11 19:12:38 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/expunge.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/expunge.h,v 1.4 89/10/23 13:37:05 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/expunge.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/expunge.h,v 1.5 91/02/28 18:43:02 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  #define ERROR_MASK		1
  #define NO_DELETE_MASK		2
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  #define ERROR_MASK		1
  #define NO_DELETE_MASK		2
*** /tmp/delete/lsdel.h	Mon Mar 11 19:03:49 1991
--- lsdel.h	Mon Mar 11 19:12:41 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/lsdel.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/lsdel.h,v 1.4 89/10/23 13:33:51 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/lsdel.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/lsdel.h,v 1.5 91/02/28 18:43:08 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  #define ERROR_MASK 1
  #define NO_DELETE_MASK 2
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  #define ERROR_MASK 1
  #define NO_DELETE_MASK 2
*** /tmp/delete/man1/delete.1	Mon Mar 11 19:03:51 1991
--- man1/delete.1	Mon Mar 11 19:12:54 1991
***************
*** 1,6 ****
! .\"	$Source: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/delete.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/delete.1,v 1.5 89/09/14 03:42:51 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
--- 1,6 ----
! .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/delete.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/delete.1,v 1.5 89/09/14 03:42:51 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
*** /tmp/delete/man1/expunge.1	Mon Mar 11 19:03:53 1991
--- man1/expunge.1	Mon Mar 11 19:12:54 1991
***************
*** 1,6 ****
! .\"	$Source: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/expunge.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/expunge.1,v 1.9 91/01/01 05:09:52 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
--- 1,6 ----
! .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/expunge.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/expunge.1,v 1.9 91/01/01 05:09:52 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
*** /tmp/delete/man1/lsdel.1	Mon Mar 11 19:03:54 1991
--- man1/lsdel.1	Mon Mar 11 19:12:55 1991
***************
*** 1,6 ****
! .\"	$Source: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/lsdel.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/lsdel.1,v 1.6 90/09/26 03:49:35 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
--- 1,6 ----
! .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/lsdel.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/lsdel.1,v 1.6 90/09/26 03:49:35 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
*** /tmp/delete/man1/purge.1	Mon Mar 11 19:03:54 1991
--- man1/purge.1	Mon Mar 11 19:12:56 1991
***************
*** 1,6 ****
! .\"	$Source: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/purge.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/purge.1,v 1.1 89/01/27 04:50:13 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
--- 1,6 ----
! .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/purge.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/purge.1,v 1.1 89/01/27 04:50:13 jik Exp $
  .\"
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
*** /tmp/delete/man1/undelete.1	Mon Mar 11 19:03:55 1991
--- man1/undelete.1	Mon Mar 11 19:12:56 1991
***************
*** 1,6 ****
! .\"	$Source: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/undelete.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/user/j/jik/delete/src/man1/RCS/undelete.1,v 1.5 89/11/02 07:13:26 jik Exp $
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
  .\" the terms and conditions for redistribution.
--- 1,6 ----
! .\"	$Source: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/undelete.1,v $
  .\"	$Author: jik $
! .\"	$Header: /afs/athena.mit.edu/astaff/project/delete/src/man1/RCS/undelete.1,v 1.5 89/11/02 07:13:26 jik Exp $
  .\" Copyright 1989 by the Massachusetts Institute of Technology.  All
  .\" rights reserved.  The file /usr/include/mit-copyright.h specifies
  .\" the terms and conditions for redistribution.
*** /tmp/delete/pattern.h	Mon Mar 11 19:03:56 1991
--- pattern.h	Mon Mar 11 19:12:43 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/pattern.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/pattern.h,v 1.5 89/11/06 19:54:32 jik Exp $
   * 
   * This program is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/pattern.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/pattern.h,v 1.6 91/02/28 18:43:19 jik Exp $
   * 
   * This program is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  int add_str();
  int add_arrays();
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  int add_str();
  int add_arrays();
*** /tmp/delete/shell_regexp.c	Mon Mar 11 19:03:57 1991
--- shell_regexp.c	Mon Mar 11 19:12:44 1991
***************
*** 1,5 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/shell_regexp.c,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
--- 1,5 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/shell_regexp.c,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_shell_regexp_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/shell_regexp.c,v 1.2 89/11/06 21:27:16 jik Exp $";
  #endif
  
  #include <com_err.h>
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_shell_regexp_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/shell_regexp.c,v 1.3 91/02/28 18:43:43 jik Exp $";
  #endif
  
  #include <com_err.h>
***************
*** 18,24 ****
  #include "shell_regexp.h"
  #include "delete_errs.h"
  #include "errors.h"
! #include "mit-copyright.h"
  
  static int real_cmp();
  
--- 18,24 ----
  #include "shell_regexp.h"
  #include "delete_errs.h"
  #include "errors.h"
! #include "mit-copying.h"
  
  static int real_cmp();
  
*** /tmp/delete/shell_regexp.h	Mon Mar 11 19:03:58 1991
--- shell_regexp.h	Mon Mar 11 19:12:44 1991
***************
*** 1,5 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/shell_regexp.h,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
--- 1,5 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/shell_regexp.h,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
***************
*** 7,15 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  extern int reg_cmp();
  
--- 7,15 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  extern int reg_cmp();
  
*** /tmp/delete/stack.c	Mon Mar 11 19:03:59 1991
--- stack.c	Mon Mar 11 19:12:45 1991
***************
*** 1,5 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/stack.c,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
--- 1,5 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/stack.c,v $
   * $Author: jik $
   *
   * This program is part of a package including delete, undelete,
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_stack_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/stack.c,v 1.8 90/09/26 03:45:37 jik Exp $";
  #endif
  
  #include <sys/types.h>
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_stack_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/stack.c,v 1.9 91/02/28 18:43:49 jik Exp $";
  #endif
  
  #include <sys/types.h>
***************
*** 20,26 ****
  #include "stack.h"
  #include "delete_errs.h"
  #include "errors.h"
! #include "mit-copyright.h"
  #include "util.h"
  
  extern char *realloc();
--- 20,26 ----
  #include "stack.h"
  #include "delete_errs.h"
  #include "errors.h"
! #include "mit-copying.h"
  #include "util.h"
  
  extern char *realloc();
*** /tmp/delete/stack.h	Mon Mar 11 19:03:59 1991
--- stack.h	Mon Mar 11 19:12:45 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/stack.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/stack.h,v 1.2 89/11/06 21:26:50 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/stack.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/stack.h,v 1.3 91/02/28 18:43:52 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  #define STACK_PUSH 	0
  #define STACK_POP	1
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  #define STACK_PUSH 	0
  #define STACK_POP	1
*** /tmp/delete/undelete.h	Mon Mar 11 19:04:00 1991
--- undelete.h	Mon Mar 11 19:12:47 1991
***************
*** 1,7 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/undelete.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/undelete.h,v 1.4 89/10/23 13:09:09 jik Exp $
   * 
   * This program is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/undelete.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/undelete.h,v 1.5 91/02/28 18:44:06 jik Exp $
   * 
   * This program is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  #define DELETEPREFIX ".#"
  #define DELETEREPREFIX "\\.#"
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  #define DELETEPREFIX ".#"
  #define DELETEREPREFIX "\\.#"
*** /tmp/delete/util.h	Mon Mar 11 19:04:01 1991
--- util.h	Mon Mar 11 19:12:49 1991
***************
*** 1,7 ****
  /*
   * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.h,v 1.11 91/02/20 17:28:33 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
--- 1,7 ----
  /*
   * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.h,v $
   * $Author: jik $
!  * $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.h,v 1.12 91/02/28 18:44:15 jik Exp $
   * 
   * This file is part of a package including delete, undelete,
   * lsdel, expunge and purge.  The software suite is meant as a
***************
*** 8,16 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
! #include "mit-copyright.h"
  
  #include <sys/stat.h>
  #ifndef S_IFLNK
--- 8,16 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
! #include "mit-copying.h"
  
  #include <sys/stat.h>
  #ifndef S_IFLNK
*** /tmp/delete/Makefile	Mon Mar 11 19:04:07 1991
--- Makefile	Mon Mar 11 19:12:26 1991
***************
*** 1,17 ****
  #     Copyright 1988 Massachusetts Institute of Technology.
  #
  #     For copying and distribution information, see the file
! #     "mit-copyright.h".
  #
! #     $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/Makefile,v $
  #     $Author: jik $
! #     $Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/Makefile,v 1.28 91/02/22 07:35:51 jik Exp $
  #
  
  DESTDIR=
  TARGETS= 	delete undelete expunge purge lsdel
  INSTALLDIR= 	/usr/bin
  MANDIR=		/usr/man
  MANSECT=	1
  CC= 		cc
  DEPEND=		/usr/bin/X11/makedepend
--- 1,24 ----
  #     Copyright 1988 Massachusetts Institute of Technology.
  #
  #     For copying and distribution information, see the file
! #     "mit-copying.h".
  #
! #     $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/Makefile,v $
  #     $Author: jik $
! #     $Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/Makefile,v 1.30 91/03/11 18:40:59 jik Exp $
  #
  
+ # If you are compiling on a system that has an st_blocks field in
+ # the stat structure whose value represents the number of 512-byte
+ # blocks taken up by the file, add -DUSE_BLOCKS to the DEFINES
+ # variable below.  If you don't know whether or not to define it, run
+ # "make block-test".
+ 
  DESTDIR=
  TARGETS= 	delete undelete expunge purge lsdel
  INSTALLDIR= 	/usr/bin
  MANDIR=		/usr/man
+ TMPDIR=		/tmp
  MANSECT=	1
  CC= 		cc
  DEPEND=		/usr/bin/X11/makedepend
***************
*** 63,69 ****
  		expunge.c lsdel.c col.c shell_regexp.c\
  		errors.c stack.c
  INCS= 		col.h delete.h directories.h expunge.h lsdel.h\
! 		mit-copyright.h pattern.h undelete.h util.h\
  		shell_regexp.h errors.h stack.h
  ETS=		delete_errs.h delete_errs.c
  ETSRCS=		delete_errs.et
--- 70,76 ----
  		expunge.c lsdel.c col.c shell_regexp.c\
  		errors.c stack.c
  INCS= 		col.h delete.h directories.h expunge.h lsdel.h\
! 		mit-copying.h pattern.h undelete.h util.h\
  		shell_regexp.h errors.h stack.h
  ETS=		delete_errs.h delete_errs.c
  ETSRCS=		delete_errs.et
***************
*** 72,78 ****
  		man1/undelete.1
  
  ARCHIVE=	README Makefile PATCHLEVEL $(SRCS) $(INCS) $(MANS)\
! 		$(ETSRCS)
  ARCHIVEDIRS= 	man1
  
  DELETEOBJS= 	delete.o util.o delete_errs.o errors.o
--- 79,85 ----
  		man1/undelete.1
  
  ARCHIVE=	README Makefile PATCHLEVEL $(SRCS) $(INCS) $(MANS)\
! 		$(ETSRCS) block-test.sh
  ARCHIVEDIRS= 	man1
  
  DELETEOBJS= 	delete.o util.o delete_errs.o errors.o
***************
*** 180,187 ****
  	-rm -f *~ *.bak *.o delete undelete lsdel expunge purge\
  		delete_errs.h delete_errs.c
  
! depend: $(SRCS) $(INCS) $(ETS)
  	$(DEPEND) -v $(CFLAGS) -s'# DO NOT DELETE' $(SRCS)
  
  $(DELETEOBJS): delete_errs.h
  $(EXPUNGEOBJS): delete_errs.h
--- 187,197 ----
  	-rm -f *~ *.bak *.o delete undelete lsdel expunge purge\
  		delete_errs.h delete_errs.c
  
! depend:: $(SRCS) $(INCS) $(ETS)
  	$(DEPEND) -v $(CFLAGS) -s'# DO NOT DELETE' $(SRCS)
+ 
+ block-test: block-test.sh
+ 	CC=$(CC); TMPDIR=$(TMPDIR); export CC TMPDIR; . block-test.sh
  
  $(DELETEOBJS): delete_errs.h
  $(EXPUNGEOBJS): delete_errs.h
*** /tmp/delete/expunge.c	Mon Mar 11 19:04:08 1991
--- expunge.c	Mon Mar 11 19:12:37 1991
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_expunge_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/expunge.c,v 1.17 91/02/20 17:42:15 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_expunge_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/expunge.c,v 1.19 91/03/11 18:43:51 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 34,40 ****
  #include "pattern.h"
  #include "expunge.h"
  #include "shell_regexp.h"
! #include "mit-copyright.h"
  #include "delete_errs.h"
  #include "errors.h"
  
--- 34,40 ----
  #include "pattern.h"
  #include "expunge.h"
  #include "shell_regexp.h"
! #include "mit-copying.h"
  #include "delete_errs.h"
  #include "errors.h"
  
***************
*** 56,62 ****
       f_links,		/* follow symbolic links */
       f_mounts;		/* follow mount points */
  
! int bytes_removed = 0;
  
  
  
--- 56,62 ----
       f_links,		/* follow symbolic links */
       f_mounts;		/* follow mount points */
  
! int space_removed = 0;
  
  
  
***************
*** 270,278 ****
       if (yield) {
  	  if (noop)
  	       printf("Total that would be expunged: %dk\n",
! 		      size_to_k(bytes_removed));
  	  else
! 	       printf("Total expunged: %dk\n", size_to_k(bytes_removed));
       }
       return status;
  }
--- 270,278 ----
       if (yield) {
  	  if (noop)
  	       printf("Total that would be expunged: %dk\n",
! 		      space_to_k(space_removed));
  	  else
! 	       printf("Total expunged: %dk\n", space_to_k(space_removed));
       }
       return status;
  }
***************
*** 377,383 ****
  
       if (interactive) {
  	  printf ("%s: Expunge %s (%dk)? ", whoami, user,
! 		  size_to_k(file_ent->specs.st_size));
  	  if (! yes()) {
  	       set_status(EXPUNGE_NOT_EXPUNGED);
  	       return error_code;
--- 377,383 ----
  
       if (interactive) {
  	  printf ("%s: Expunge %s (%dk)? ", whoami, user,
! 		  specs_to_k(file_ent->specs));
  	  if (! yes()) {
  	       set_status(EXPUNGE_NOT_EXPUNGED);
  	       return error_code;
***************
*** 385,394 ****
       }
  
       if (noop) {
! 	  bytes_removed += file_ent->specs.st_size;
  	  printf("%s: %s (%dk) would be expunged (%dk total)\n", whoami, user,
! 		 size_to_k(file_ent->specs.st_size),
! 		 size_to_k(bytes_removed));
  	  return 0;
       }
  
--- 385,394 ----
       }
  
       if (noop) {
! 	  space_removed += specs_to_space(file_ent->specs);
  	  printf("%s: %s (%dk) would be expunged (%dk total)\n", whoami, user,
! 		 specs_to_k(file_ent->specs),
! 		 space_to_k(space_removed));
  	  return 0;
       }
  
***************
*** 397,407 ****
       else
  	  status = unlink(real);
       if (! status) {
! 	  bytes_removed += file_ent->specs.st_size;
  	  if (verbose)
  	       printf("%s: %s (%dk) expunged (%dk total)\n", whoami, user,
! 		      size_to_k(file_ent->specs.st_size),
! 		      size_to_k(bytes_removed));
  	  return 0;
       }
       else {
--- 397,407 ----
       else
  	  status = unlink(real);
       if (! status) {
! 	  space_removed += specs_to_space(file_ent->specs);
  	  if (verbose)
  	       printf("%s: %s (%dk) expunged (%dk total)\n", whoami, user,
! 		      specs_to_k(file_ent->specs),
! 		      space_to_k(space_removed));
  	  return 0;
       }
       else {
*** /tmp/delete/lsdel.c	Mon Mar 11 19:04:10 1991
--- lsdel.c	Mon Mar 11 19:12:40 1991
***************
*** 7,17 ****
   * prefix.
   *
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_lsdel_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/lsdel.c,v 1.14 91/02/20 17:36:11 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 7,17 ----
   * prefix.
   *
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_lsdel_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/lsdel.c,v 1.16 91/03/11 18:43:29 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 36,42 ****
  #include "pattern.h"
  #include "lsdel.h"
  #include "shell_regexp.h"
! #include "mit-copyright.h"
  #include "delete_errs.h"
  #include "errors.h"
  
--- 36,42 ----
  #include "pattern.h"
  #include "lsdel.h"
  #include "shell_regexp.h"
! #include "mit-copying.h"
  #include "delete_errs.h"
  #include "errors.h"
  
***************
*** 44,50 ****
  extern time_t current_time;
  extern int errno;
  
! int byte_total = 0;
  int dirsonly, recursive, yield, f_links, f_mounts;
  time_t timev;
  
--- 44,50 ----
  extern time_t current_time;
  extern int errno;
  
! int space_total = 0;
  int dirsonly, recursive, yield, f_links, f_mounts;
  time_t timev;
  
***************
*** 188,194 ****
       }
       if (yield)
  	  printf("\nTotal space taken up by file%s: %dk\n",
! 		 (total == 1 ? "" : "s"), size_to_k(byte_total));
  
       return status;
  }
--- 188,194 ----
       }
       if (yield)
  	  printf("\nTotal space taken up by file%s: %dk\n",
! 		 (total == 1 ? "" : "s"), space_to_k(space_total));
  
       return status;
  }
***************
*** 246,252 ****
  	       skipped++;
  	       continue;
  	  }
! 	  byte_total += leaf->specs.st_size;
       }
       free((char *) files);
       return(num-skipped);
--- 246,252 ----
  	       skipped++;
  	       continue;
  	  }
! 	  space_total += specs_to_space(leaf->specs);
       }
       free((char *) files);
       return(num-skipped);
*** /tmp/delete/undelete.c	Mon Mar 11 19:04:12 1991
--- undelete.c	Mon Mar 11 19:12:46 1991
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_undelete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/undelete.c,v 1.22 91/02/20 17:27:38 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_undelete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/undelete.c,v 1.23 91/02/28 18:44:00 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 33,39 ****
  #include "directories.h"
  #include "undelete.h"
  #include "shell_regexp.h"
! #include "mit-copyright.h"
  #include "errors.h"
  
  extern char *realloc();
--- 33,39 ----
  #include "directories.h"
  #include "undelete.h"
  #include "shell_regexp.h"
! #include "mit-copying.h"
  #include "errors.h"
  
  extern char *realloc();
*** /tmp/delete/util.c	Mon Mar 11 19:04:13 1991
--- util.c	Mon Mar 11 19:12:48 1991
***************
*** 7,17 ****
   * prefix.
   *
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_util_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.c,v 1.21 91/02/20 17:28:11 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 7,17 ----
   * prefix.
   *
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_util_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/util.c,v 1.22 91/02/28 18:44:11 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 39,45 ****
  #include "delete_errs.h"
  #include "util.h"
  #include "directories.h"
! #include "mit-copyright.h"
  #include "errors.h"
  
  extern char *getenv();
--- 39,45 ----
  #include "delete_errs.h"
  #include "util.h"
  #include "directories.h"
! #include "mit-copying.h"
  #include "errors.h"
  
  extern char *getenv();
*** /tmp/delete/delete.c	Mon Mar 11 19:04:18 1991
--- delete.c	Mon Mar 11 19:12:30 1991
***************
*** 7,17 ****
   * prefix.
   *
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_delete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete.c,v 1.24 91/02/20 17:24:51 jik Exp $";
  #endif
  
  #include <sys/types.h>
--- 7,17 ----
   * prefix.
   *
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_delete_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/delete.c,v 1.25 91/02/28 18:42:16 jik Exp $";
  #endif
  
  #include <sys/types.h>
***************
*** 31,37 ****
  #include "delete_errs.h"
  #include "util.h"
  #include "delete.h"
! #include "mit-copyright.h"
  
  
  
--- 31,37 ----
  #include "delete_errs.h"
  #include "util.h"
  #include "delete.h"
! #include "mit-copying.h"
  
  
  
*** /tmp/delete/directories.c	Mon Mar 11 19:04:20 1991
--- directories.c	Mon Mar 11 19:12:33 1991
***************
*** 1,5 ****
  /*
!  * $Source: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/directories.c,v $
   * $Author: jik $
   * 
   * This program is part of a package including delete, undelete,
--- 1,5 ----
  /*
!  * $Source: /afs/athena.mit.edu/astaff/project/delete/src/RCS/directories.c,v $
   * $Author: jik $
   * 
   * This program is part of a package including delete, undelete,
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if !defined(lint) && !defined(SABER)
!      static char rcsid_directories_c[] = "$Header: /afs/athena.mit.edu/user/j/jik/delete/src/RCS/directories.c,v 1.18 91/02/22 06:32:25 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if !defined(lint) && !defined(SABER)
!      static char rcsid_directories_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/directories.c,v 1.20 91/03/11 18:42:56 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 30,36 ****
  #include "delete_errs.h"
  #include "util.h"
  #include "directories.h"
! #include "mit-copyright.h"
  #include "errors.h"
  
  extern char *realloc();
--- 30,36 ----
  #include "delete_errs.h"
  #include "util.h"
  #include "directories.h"
! #include "mit-copying.h"
  #include "errors.h"
  
  extern char *realloc();
***************
*** 232,242 ****
       specs->st_mode = realspecs.st_mode;
       specs->st_size = realspecs.st_size;
       specs->st_ctime = realspecs.st_ctime;
! #ifdef notdef
!      /*
!       * See comment in directories.h to understand why this is
!       * disabled.
!       */
       specs->st_blocks = realspecs.st_blocks;
  #endif
  
--- 232,238 ----
       specs->st_mode = realspecs.st_mode;
       specs->st_size = realspecs.st_size;
       specs->st_ctime = realspecs.st_ctime;
! #ifdef USE_BLOCKS
       specs->st_blocks = realspecs.st_blocks;
  #endif
  
*** /tmp/delete/pattern.c	Mon Mar 11 19:04:27 1991
--- pattern.c	Mon Mar 11 19:12:43 1991
***************
*** 7,17 ****
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copyright.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_pattern_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/pattern.c,v 1.21 91/02/20 17:27:03 jik Exp $";
  #endif
  
  #include <stdio.h>
--- 7,17 ----
   * replacement for rm which allows for file recovery.
   * 
   * Copyright (c) 1989 by the Massachusetts Institute of Technology.
!  * For copying and distribution information, see the file "mit-copying.h."
   */
  
  #if (!defined(lint) && !defined(SABER))
!      static char rcsid_pattern_c[] = "$Header: /afs/athena.mit.edu/astaff/project/delete/src/RCS/pattern.c,v 1.22 91/02/28 18:43:11 jik Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 32,38 ****
  #include "directories.h"
  #include "undelete.h"
  #include "shell_regexp.h"
! #include "mit-copyright.h"
  #include "delete_errs.h"
  #include "errors.h"
  #include "stack.h"
--- 32,38 ----
  #include "directories.h"
  #include "undelete.h"
  #include "shell_regexp.h"
! #include "mit-copying.h"
  #include "delete_errs.h"
  #include "errors.h"
  #include "stack.h"
*** /dev/null	Mon Mar 11 19:23:48 1991
--- block-test.sh	Mon Mar 11 19:12:28 1991
***************
*** 0 ****
--- 1,65 ----
+ cd ${TMPDIR-/tmp}
+ 
+ cat >test$$.c <<PROGRAM_IS_DONE
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+ #include <stdio.h>
+ 
+ main()
+ {
+      struct stat statbuf;
+      char buf[1024];
+      int testfile;
+      char filename[20];
+ 
+      sprintf(filename, "test%d.out", getppid());
+ 
+      testfile = open(filename, O_CREAT | O_RDWR | O_TRUNC, 0644);
+      if (testfile < 0) {
+ 	  fprintf(stderr, "Could not open temporary file \"%s\".\n", filename);
+ 	  exit(1);
+      }
+ 
+      if (write(testfile, buf, sizeof(buf)) != sizeof(buf)) {
+ 	  fprintf(stderr, "Could not write all data to file \"%s\".\n",
+ 		  filename);
+ 	  exit(1);
+      }
+ 
+      if (close(testfile) < 0) {
+ 	  fprintf(stderr, "Error closing \"%s\".\n", filename);
+ 	  exit(1);
+      }
+ 
+      if (stat(filename, &statbuf) < 0) {
+ 	  fprintf(stderr, "Could not stat file \"%s\".\n", filename);
+ 	  exit(1);
+      }
+ 
+      if (statbuf.st_blocks == 2) {
+ 	  printf("You SHOULD define USE_BLOCKS.\n");
+      }
+      else {
+ 	  printf("You SHOULD NOT define USE_BLOCKS.\n");
+ 	  printf("However, you have an interesting machine that delete might be made to work\nbetter with.  Please contact the author (see the README file for an address)\nand tell him what kind of machine you have and what operating system it is\nrunning.");
+      }
+      exit(0);
+ }
+ PROGRAM_IS_DONE
+ 
+ 
+ if ${CC-cc} -o test$$ test$$.c 2>&1 >/dev/null; then
+ 	if ./test$$; then : ;
+ 	else
+ 		echo "Test program did not succeed."
+ 		echo "This means you probably shouldn't define USE_BLOCKS."
+ 	fi
+ else
+ 	echo "Could not compile test program."
+ 	echo "This means you probably shouldn't define USE_BLOCKS."
+ fi
+ 
+ 
+ rm test$$*
+ exit 0

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent at sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent at uunet.uu.net.



More information about the Comp.sources.misc mailing list