You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.8 KiB

1 month ago
  1. % Copyright (C) 2001-2023 Artifex Software, Inc.
  2. % All Rights Reserved.
  3. %
  4. % This software is provided AS-IS with no warranty, either express or
  5. % implied.
  6. %
  7. % This software is distributed under license and may not be copied,
  8. % modified or distributed except as expressly authorized under the terms
  9. % of the license contained in the file LICENSE in this distribution.
  10. %
  11. % Refer to licensing information at http://www.artifex.com or contact
  12. % Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
  13. % CA 94129, USA, for further information.
  14. %
  15. %
  16. % $Id: cat.ps 8331 2008-02-05 11:07:00Z kens $
  17. %
  18. % Appends one file to another. Primarily used to overcome the
  19. % 'copy' limitation of Windows command shell for ps2epsi
  20. %
  21. % the files to be appended are given by the environament
  22. % variables %infile% and %outfile%. %infile% is appended to
  23. % %outfile%
  24. %
  25. /datastring 1024 string def
  26. {
  27. (outfile) getenv
  28. {
  29. /outfilename exch def
  30. (infile) getenv
  31. {
  32. /infilename exch def
  33. infilename status
  34. {
  35. pop pop pop pop outfilename status
  36. {
  37. pop pop pop pop
  38. infilename (r) file /infile exch def
  39. outfilename (a+) file /outfile exch def
  40. {
  41. infile datastring readstring
  42. {
  43. outfile exch writestring
  44. }
  45. {
  46. dup length 0 gt
  47. {outfile exch writestring} {pop} ifelse
  48. exit
  49. } ifelse
  50. } loop
  51. infile closefile
  52. outfile closefile
  53. }
  54. {
  55. (Failed to find file ) print outfilename ==
  56. } ifelse
  57. }
  58. {
  59. (Failed to find file ) print infilename ==
  60. } ifelse
  61. }
  62. {
  63. (Couldn't find %infile% environment variable) ==
  64. } ifelse
  65. }
  66. {
  67. (Couldn't find %outfile% environment variable) ==
  68. }
  69. ifelse
  70. } bind
  71. exec