cpne.pp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993,97 by Pierre Muller,
  5. member of the Free Pascal development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. program copy_if_not_empty;
  13. uses dos;
  14. var in,out : file;
  15. begin
  16. if paramcount>0 then
  17. begin
  18. assign(in,paramstr(1));
  19. if filerec(in).size=0 then
  20. begin
  21. erase(in);
  22. exit;
  23. end;
  24. end;
  25. if paramcount>1 then
  26. rename(paramstr(1),paramstr(2));
  27. end.
  28. {
  29. $Log$
  30. Revision 1.1 1998-03-25 11:18:43 root
  31. Initial revision
  32. Revision 1.3 1998/01/26 11:59:29 michael
  33. + Added log at the end
  34. Working file: rtl/inc/cpne.pp
  35. description:
  36. ----------------------------
  37. revision 1.2
  38. date: 1997/12/01 15:33:31; author: michael; state: Exp; lines: +14 -0
  39. + added copyright reference in header.
  40. ----------------------------
  41. revision 1.1
  42. date: 1997/11/27 08:33:46; author: michael; state: Exp;
  43. Initial revision
  44. ----------------------------
  45. revision 1.1.1.1
  46. date: 1997/11/27 08:33:46; author: michael; state: Exp; lines: +0 -0
  47. FPC RTL CVS start
  48. =============================================================================
  49. }