home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / graphic / utilities / pegger / rexx / move_destination.peg < prev    next >
Text File  |  1995-07-10  |  1KB  |  38 lines

  1. /* PEGGER ARexx Script to move the destination file after processing      */
  2.  
  3. /* Primarily for SNOOP CJPEG where the final destination for the JPEG     */
  4. /* is across a network so that your renderer saves the image locally      */
  5. /* and after PEGGER does a SNOOP compress of the image with REPLACE it    */
  6. /* moves the JPEG to the final destination on the network and deletes     */
  7. /* the JPEG of the original image on the local system.                    */
  8.  
  9. /* You need to specify the directory where you want the file to           */
  10. /* go including the trailing '/' if needed in the variable copyto         */
  11.  
  12. copyto = "WORK:"
  13.  
  14. /*    And now we can get the source file name and destination file name */
  15. /* For CJPEG the source is an image file, and the destination the JPEG file */
  16. /* For DJPEG the source is the JPEG file, and the destination is the image file */
  17.  
  18. arg source,dest
  19.  
  20. /*    Get the position in the destination file name path of the file name */
  21. last = LASTPOS( "/",dest )
  22.  
  23. if( last == 0 ) then do
  24.     last = LASTPOS( ":",dest )
  25.     end
  26.  
  27. if( last > 0 ) then do
  28.     /* Get the filename */
  29.     last = last + 1
  30.     file = SUBSTR( dest, last )
  31.     /* Copy the JPEG file to its final destination */
  32.     ADDRESS COMMAND 'copy ' || dest || ' ' || copyto || file
  33.     if( RC == 0 )then do
  34.         /* If the copy suceeded, delete the JPEG of the original image */
  35.         ADDRESS COMMAND 'delete ' || dest
  36.         end
  37.     end
  38.