Newsgroup: it.comp.os.os2
Titolo: File duplicati

Dove posso trovare una utility che mi dice se esistono files (DLL) 
duplicate sul disco?
Grazie e a tutti e ciao.
LittleWave



su Hobbes
http://hobbes.nmsu.edu/pub/os2/util/disk/fdupe010.zip
http://hobbes.nmsu.edu/pub/os2/util/disk/fd101.zip
http://hobbes.nmsu.edu/pub/os2/util/file/kc-001.zip
http://hobbes.nmsu.edu/pub/os2/util/file/clone_kill.zip
http://hobbes.nmsu.edu/pub/os2/util/file/clone240.zip
Gente, ma basta andare qui:
http://hobbes.nmsu.edu/
ed effettuare una ricerca...
e' cosi' complicato?
io ho fatto la stessa cosa...
 
Massimo
=-  Quasar BBS     
http://bbs.quasarbbs.net
 
=-  
irc.quasarbbs.net
      channel: #eCSita   
=-  
http://www.teamos2.it
 
http://www.ecomstation.com/

On Wed, 23 Jan 2002 09:11:04 UTC, 
o.spallanz...@tin.it
 wrote:

Se per caso hai installato XWorkplace (vedi link sotto), puoi 
controllare path, libpath etc dall'oggetto "Kernel" nella cartella 
"Impostazione del sistema".
-- 
ciao, Gabriele
[ 
http://www.quasarbbs.com/xwp
 ]
[ 
http://www.quasarbbs.com/ecsoft2/
 ]

duplicate sul disco?
Eccoti accontentato:
/*--------------------------------------------- a.s. 14 Dec 2001 ---------*\
|                                                                          |
|           LISTDLL.CMD  - Version 1.0 - Version Date 1994-09-29           |
|                          Version 1.1 - Version Date 1994-10-25           |
|                          Version 1.2 - Version Date 1995-01-03           |
|                          Version 1.3 - Version Date 1995-09-29           |
|                          Version 1.4 - Version Date 1995-12-18           |
|                          Version 1.5 - Version Date 1996-09-14           |
|                          Version 1.6 - Version Date 1996-10-27           |
|                          Version 1.7 - Version Date 1997-10-13           |
|                                                                          |
|               Copyright (C) 1994-97 by C F S Nevada, Inc.                |
|                                                                          |
|                  by Dick Goran  - Voice    
702-732-9616
                  |
|                                 - FAX      
702-732-3847
                  |
|                                 - CIS      71154,2002                    |
|                                 - Internet 
dgo...@cfsrexx.com
            |
|                                                                          |
| ------------------------------------------------------------------------ |
|  REXXLIB.DLL  - OS/2 REXX external function library                      |
|                 (c) Copyright 1992-95 Quercus Systems                    |
\*------------------------------------------------------------------------*/
/*
   This program will produce an ASCII file (LISTDLL.TXT) containing a
   list of all of all of the DLLs that are "addressable" via the LIBPATH
   statement. This program may be run from any directory and will include
   DLLs in the current directory if the .; token is included in the LIBPATH
   statement located in CONFIG.SYS on the IPL (boot drive).
   An alternate output file can optionally be specified on the command line
   (the only possible parameter).
   This program is released to the public, free of charge.
   Updates & Fixes:
   ================
   1) LIBPATH string was searched for in uppercase only.
   2) Duplicate LIBPATH entries were not being listed.
   3) Add the inclusion of any directories specified with the
      BeginLibPath and EndLibPath facility introduced in OS/2 Version 3.0
   1.4 - 12/18/95
   --------------
   1) Output list was not in search order
   1.5 - 09/14/96
   --------------
   1) LISTDLL.TXT file will be written to the root directory of the boot
      drive rather than the directory where the program resides.
   1.6 - 10/27/96
   --------------
   1) Correct errors in output header.
   1.7 - 10/13/97
   --------------
   1) Additional comments added.
*/
GBL.            = ''                /* initialize stem */
GBL.list        = 'GBL.',
                  '_crlf',
                  ''
GBL.environment = 'OS2ENVIRONMENT'
parse Arg         GBL.command_line
parse Version     GBL.REXX_version,
                  GBL.REXX_version_level,
                  GBL.REXX_version_day,
                  GBL.REXX_version_month,
                  GBL.REXX_version_year .
parse Source      GBL.operating_system,
                  GBL.calling_environment,
                  GBL.program_path_and_name
parse upper value VALUE( 'PATH',, GBL.environment ) with '\OS2\SYSTEM' -2,
                  GBL.boot_drive                                       +2
parse value DATE('S') with year +4 mm +2 dd
GBL.current_date    = year || '/' || mm || '/' || dd
GBL.program_version = 1.7           /* version / mod of this program */
GBL.program_name    = STRIP( FILESPEC( 'N', GBL.program_path_and_name ) )
GBL.program_path    = STRIP( FILESPEC( 'D', GBL.program_path_and_name ) ||,
                             FILESPEC( 'P', GBL.program_path_and_name ) )
dot_ptr = LASTPOS( '.', GBL.program_name )
parse value GBL.program_name with,
   GBL.program_fn,
   =(dot_ptr) +1,
   GBL.program_fe
GBL.program_fe = TRANSLATE( GBL.program_fe )
drop dd dot_ptr mm year
/*---------------*\
|  Register APIs  |
\*---------------*/
/* REXXUTIL */
if RxFuncQuery( 'SysLoadFuncs' ) ª= 0 then
   do
      call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
      call SysLoadFuncs
   end
/* REXXLIB - (c) Quercus Systems */
if RxFuncQuery( 'rexxlibregister' ) ª= 0 then
   do
      if GBL.REXX_version = 'REXX/Personal' then
         do
            DLL_name = 'QREXXLIB'
         end
      else
         do
            DLL_name = 'REXXLIB'
         end
      call RxFuncAdd 'REXXLibRegister', DLL_name, 'rexxlibregister'
      call REXXLibRegister
   end
call TIME 'E'                       /* set elapsed timer - sssss.uuuuu */
say 'Begin' GBL.program_name 'at' TIME('N')
/*------------------------*\
|  Enable trap processing  |
|    if REXXLIB present    |
\*------------------------*/
   SIGNAL ON ERROR
   SIGNAL ON FAILURE
   SIGNAL ON HALT
   SIGNAL ON NOVALUE
   SIGNAL ON SYNTAX
GBL.output_file       = GBL.boot_drive || '\' ||,
                        GBL.program_fn || '.TXT'
GBL.output_line_count = 0
GBL.column_blanks     = COPIES( ' ', 2 )
GBL.conflict_count    = 0           /* number of multiple DLL entries */
_crlf                 = '0D0A'x     /* carriage return / line feed */
/*-------------------------------------------------------*\
|  Check for output file being specified on command line  |
\*-------------------------------------------------------*/
parse ARG parameter_1
if LEFT( parameter_1, 1 ) = '"' then
   do
      parameter_1 = STRIP( parameter_1, 'B', '"' )
   end
else
   if WORDS( parameter_1 ) > 1 then
      do
         say '   The only parameter allowed is the output file name.'
         say '   Program cancelled.'
         call EOJ 255
      end
if parameter_1 <> '' then
   do
      GBL.output_file = parameter_1
   end
call SysFileDelete GBL.output_file  /* erase any prior file */
if RESULT > 2 then
   do
      say '   SysFileDelete returned ' ||,
          RESULT                       ||,
          ' for file name '            ||,
          GBL.output_file
      say '   Program cancelled.'
      call EOJ RESULT
   end
/*----------------------------------------------------------*\
|  Read CONFIG.SYS from IPL drive to find LIBPATH statement  |
\*----------------------------------------------------------*/
config_sys_file_name  = GBL.boot_drive ||,
                        '\config.sys'
if STREAM( config_sys_file_name, 'C', 'QUERY EXISTS' ) = '' then
   do
      say 'Unable to locate '  ||,
          config_sys_file_name ||,
          '. Program cancelled.'
      call EOJ 254
   end
/* read entire CONFIG.SYS file */
config_sys_file_area = CHARIN( config_sys_file_name, 1,
CHARS(config_sys_file_name) ) call STREAM config_sys_file_name, 'C', 'CLOSE'
uppercase_config_sys_file_area = TRANSLATE( config_sys_file_area )
/*--------------------------------------*\
|  Find LIBPATH statement in CONFIG.SYS  |
\*--------------------------------------*/
libpath_search_arg = _crlf || 'LIBPATH='
libpath_beg_pointer =,
   POS( libpath_search_arg, uppercase_config_sys_file_area ) +,
   LENGTH(libpath_search_arg)
if libpath_beg_pointer = LENGTH(libpath_search_arg) then
   do
      say 'Unable to locate LIBPATH= in ' ||,
          config_sys_file_name            ||,
          '. Program cancelled.'
      call EOJ 254
   end
else
   do
      /* point to next cr/lf after LIBPATH= */
      libpath_end_pointer = POS( _crlf,,
                                 config_sys_file_area,,
                                 libpath_beg_pointer )
      if libpath_end_pointer = 0 then
         do
            say 'Unable to locate end of LIBPATH line. Should not occur.'
            call EOJ 254
         end
      else
         do
            /* isolate value of LIBPATH= line */
            libpath_line = SUBSTR( config_sys_file_area,,
                                   libpath_beg_pointer,,
                                   libpath_end_pointer -
libpath_beg_pointer)
            /* assure trailing semicolon */
            if RIGHT( libpath_line, 1 ) <> ';' then
               do
                  libpath_line = libpath_line || ';'
               end
         end
   end
/*--------------------------------------------------------*\
|  Prefix and suffix any BeginLibPath & EndLibPath values  |
|                   using SET command                      |
\*--------------------------------------------------------*/
'@RXQUEUE /clear'                   /* clear any data from REXX data queue
*/ '@set | RXQUEUE'                    /* write env variables to REXX queue
*/
/* Read environment variables from queue */
do while QUEUED() > 0
   input_line = LINEIN( 'QUEUE:' )
   parse upper value input_line with,
      pre_equal,
      '=',
      post_equal
   select
      when pre_equal = 'BEGINLIBPATH ' then
         do
            /* prefix LIBPATH value with BeginLibPath value */
            libpath_line =,
               STRIP( post_equal ) ||,
               libpath_line
         end
      when pre_equal = 'ENDLIBPATH ' then
         do
            /* suffix LIBPATH value with EndLibPath value */
            libpath_line =,
               libpath_line        ||,
               STRIP( post_equal )
         end
   otherwise
      nop
   end
end
/*------------------------------------------*\
|  Build SysFileTree array of all DLL files  |
\*------------------------------------------*/
heading_3           = ''            /* current directory if .; included */
libpath_tokens      = libpath_line  /* copy LIBPATH data */
path_table.0        = 0             /* table of all DLL paths */ path_index.        
= 0             /* associative array for path_table */ search_order_stem.0 =
0             /* combined array of DLL files - search order */
do while libpath_tokens <> ''
   parse value libpath_tokens with,
      DLL_path ';' libpath_tokens
   _pt = path_table.0 + 1      /* potential subscript */
   if DLL_path = '.' then
      do
         /* add current directory */
         DLL_path = DIRECTORY()
         uppercase_DLL_path = TRANSLATE( DLL_path )
         heading_3 = 'Search path includes (.;) = ' || DLL_path
      end
   else
      /* check for duplicate path */
      do
         uppercase_DLL_path = TRANSLATE( DLL_path )
         if path_index.UPPERCASE_DLL_PATH > 0 then
            do
               output_line =,
                   DLL_path ||,
                   ' is duplicated in LIBPATH.'
               call LINEOUT GBL.output_file, output_line || _crlf
               GBL.output_line_count = GBL.output_line_count + 1
               say '   ' || output_line
               iterate
            end
      end
   path_table._pt = uppercase_DLL_path  /* add DLL path to table */
   path_table.0 = _pt
   path_index.uppercase_DLL_path = _pt  /* create associative index */
   call SysFileTree DLL_path || '\*.DLL',,
                    'temp_stem',,
                    'F'
   if temp_stem.0 = 0 then iterate
   call ARRAYSORT 'temp_stem', 1, temp_stem.0,,
                  WORDINDEX( temp_stem.1, 5 ), 100, 'A', 'I'
   call ARRAYCOPY 'temp_stem', 'search_order_stem', 1, search_order_stem.0 +
1 end
/*------------------------------------*\
|  Write heading lines to output_file  |
\*------------------------------------*/
say '   Building ' ||,
    GBL.output_file
parse value GBL.program_name with,
   fn '.' fext
heading_1 =,
   DATE( 'N' ) || COPIES( ' ', 3 ) ||,
   TIME( 'N' ) || COPIES( ' ', 3 ) ||,
   TRANSLATE( fn )                 ||,
   COPIES( ' ', 1 )                ||,
   GBL.program_version             ||,
   ' - Addressable DLLs per '      ||,
   TRANSLATE( config_sys_file_name )
call LINEOUT GBL.output_file, heading_1
GBL.output_line_count = GBL.output_line_count + 1
output_line =,
   '(c) 1994-' || LEFT( GBL.current_date, 4 ) || ' by Dick Goran, C F S
Nevada, Inc. ' ||,
   '(
dgo...@cfsrexx.com
)'
if LENGTH( heading_1 ) > LENGTH( output_line ) then
   do
      heading_2 = CENTER( output_line, LENGTH(heading_1) )
   end
else
   do
      heading_2 = output_line
   end
call LINEOUT GBL.output_file, heading_2
GBL.output_line_count = GBL.output_line_count + 1
if heading_3 <> '' then
   do
      call LINEOUT GBL.output_file, CENTER( heading_3, LENGTH(heading_1) )
||,
                                    _crlf
      GBL.output_line_count = GBL.output_line_count + 2
   end
/*---------------------------*\
|  List directories included  |
\*---------------------------*/
includes = 'Includes: '
output_line = includes
do _pt = 1 to path_table.0
   if ( LENGTH( output_line ) + LENGTH( path_table._pt ) ) >,
      LENGTH( heading_1 ) then
      do
         call LINEOUT GBL.output_file, output_line
         GBL.output_line_count = GBL.output_line_count + 1
         output_line = COPIES( ' ', LENGTH( includes ) )
      end
   output_line =,
      output_line   ||,
      path_table._pt || ';'
end
if LENGTH( output_line ) > LENGTH( includes ) then
   do
      call LINEOUT GBL.output_file, output_line
      GBL.output_line_count = GBL.output_line_count + 1
   end
call LINEOUT GBL.output_file, ' '
GBL.output_line_count = GBL.output_line_count + 1
/*-----------------------------------------------------*\
|  Build an associative array of all DLL names looking  |
|  for any conflicts arising from search order along    |
|  with an array to allow sorting by DLL name.          |
\*-----------------------------------------------------*/
index_stem. = ''
sort_stem.0 = 0
do sos = 1 to search_order_stem.0
   parse upper value search_order_stem.sos with,
      search_order_file_date,
      search_order_file_time,
      search_order_file_size,
      search_order_file_attr,
      search_order_file_path_and_name
   search_order_file_path_and_name = STRIP( search_order_file_path_and_name
)
   search_order_file_path = FILESPEC( 'D', search_order_file_path_and_name )
||,
                            FILESPEC( 'P', search_order_file_path_and_name )
   parse value FILESPEC( 'N', search_order_file_path_and_name ) with,
      search_order_file_name '.' search_order_file_ext
   /*---------------------------*\
   |  Add to array to be sorted  |
   \*---------------------------*/
   ss = sort_stem.0 + 1
   sort_stem.0 = ss
   sort_stem.ss =,
      LEFT( FILESPEC( 'N', search_order_file_path_and_name ), 13 ) ||,
      RIGHT( sos, 6)
   /*----------------------------------*\
   |  Check for prior existence of DLL  |
   \*----------------------------------*/
   if index_stem.SEARCH_ORDER_FILE_NAME <> '' then
      do
         index_stem.SEARCH_ORDER_FILE_NAME =,
            index_stem.SEARCH_ORDER_FILE_NAME,
            sos
      end
   else
      do
         index_stem.SEARCH_ORDER_FILE_NAME =,
            sos                                /* search order number */
      end
end
/*-------------------------------*\
|  List any multiple occurrences  |
\*-------------------------------*/
do sos = 1 to search_order_stem.0
   parse upper value search_order_stem.sos with,
      search_order_file_date,
      search_order_file_time,
      search_order_file_size,
      search_order_file_attr,
      search_order_file_path_and_name
   search_order_file_path_and_name = STRIP( search_order_file_path_and_name
)
   search_order_file_path = FILESPEC( 'D', search_order_file_path_and_name )
||,
                            FILESPEC( 'P', search_order_file_path_and_name )
   parse value FILESPEC( 'N', search_order_file_path_and_name ) with,
      search_order_file_name '.' search_order_file_ext
   /*----------------------------------*\
   |  Check for prior existence of DLL  |
   \*----------------------------------*/
   index_list = index_stem.SEARCH_ORDER_FILE_NAME
   if WORDS( index_list ) > 1 then
      if sos = WORD( index_list, 1 ) then
         do
            /* Show precedence conflict in output listing */
            call LIST_SUPERCEDED_OCCURRENCES index_list
            GBL.conflict_count = GBL.conflict_count + 1
         end
end
/*-----------------------------*\
|  Create TXT file of all DLLs  |
\*-----------------------------*/
output_line =,
   'List of all DLLs sorted by DLL name (case insensitive) & search order'
heading_4 = CENTER( output_line, LENGTH(heading_1) ) || _crlf call LINEOUT
GBL.output_file, heading_4
GBL.output_line_count = GBL.output_line_count + 1
call ARRAYSORT 'sort_stem', 1, sort_stem.0, 1, 100, 'A', 'I'
do sos = 1 to search_order_stem.0
   parse value search_order_stem.sos with,
      file_date,
      file_time,
      file_size,
      file_attr,
      file_path_and_name
   file_path_and_name = STRIP( file_path_and_name )
   file_path = FILESPEC( 'D', file_path_and_name ) ||,
               FILESPEC( 'P', file_path_and_name )
   parse value FILESPEC( 'N', file_path_and_name ) with,
      file_name '.' file_ext
   output_line =,
      RIGHT( file_date , 8 )                          || GBL.column_blanks
||,
      RIGHT( file_time , 6 )                          || GBL.column_blanks
||,
      RIGHT( EDIT( file_size ), 10 )                  || GBL.column_blanks
||,
      LEFT( FILESPEC( 'N', file_path_and_name ), 12 ) || GBL.column_blanks
||,
      file_path
   call LINEOUT GBL.output_file, output_line
end
call STREAM GBL.output_file, 'C', 'CLOSE'
output_line =,
   EDIT( search_order_stem.0 ) ||,
   ' DLLs found'
call LINEOUT GBL.output_file, _crlf || CENTER( output_line,
LENGTH(heading_1) ) GBL.output_line_count = GBL.output_line_count + 1
/*-----------------------------------------*\
|  Inform user if there were any conflicts  |
\*-----------------------------------------*/
if GBL.conflict_count > 0 then
   do
      if GBL.conflict_count = 1 then
         do
            was_were = 'was '
         end
      else
         do
            was_were = 'were '
         end
      say '   There '                 ||,
          was_were                    ||,
          GBL.conflict_count          ||,
          ' DLL conflicts listed in ' ||,
          GBL.output_file
   end
call EOJ 0
/*----------------------------------------------------------------*\ |                       
EDIT REXX function                        |
| ---------------------------------------------------------------- |
|                                                                  |
|   The following REXX subroutine / function will return an        |
|   edited integer or decimal value with appropriate               |
|   punctuation inserted appropriately (subject to DIGITS() ).     |
|   The correct punctuation characters are obtained from the       |
|   object system. For example (assuming US notation):             |
|                                                                  |
|         EDIT(12345)                                              |
|                                                                  |
|    will return 12,345; and                                       |
|                                                                  |
|         EDIT(-123456.78)                                         |
|                                                                  |
|    will return -123,456.78                                       |
|                                                                  |
|    The intent behind the creation of this function was speed.    |
|    It is being released to the public domain by the author -     |
|    Dick Goran, author of the "REXX Reference Summary Handbook"   |
|       71154,2002                 CompuServe                      |
|       
dgo...@cfsrex.com
          Internet                        |
|                                                                  |
|    88/04/24 - originally written for DOS Personal REXX           |
|    93/12/25 - handle negative values & international notation    |
|               (presumes REXXUTIL registered)                     |
|                                                                  |
\*----------------------------------------------------------------*/ EDIT:
   Procedure
/* first time here, build translate tables */
SIGNAL OFF NOVALUE
if LEFT(e1, 1) <> '01'x then
   do
      e1 = XRANGE('01'x, '19'x)
      e2 = XRANGE('01'x, '03'x) || '19'x ||,
           XRANGE('04'x, '06'x) || '19'x ||,
           XRANGE('07'x, '09'x) || '19'x ||,
           XRANGE('0A'x, '0C'x) || '19'x ||,
           XRANGE('0D'x, '0F'x) || '19'x ||,
           XRANGE('10'x, '12'x) || '19'x ||,
           XRANGE('13'x, '15'x) || '19'x ||,
           XRANGE('16'x, '18'x)
      /* get punctuation characters from INI file  */
      decimal  = STRIP( SysIni( 'USER',,
                                'PM_National',,
                                'sDecimal' ), 'T', '00'x )
      thousand = STRIP( SysIni( 'USER',,
                                'PM_National',,
                                'sThousand' ), 'T', '00'x )
   end
SIGNAL ON NOVALUE
/* return BAD if non-numeric data */
if DATATYPE( ARG(1) ) <> 'NUM' then
   return 'BAD'
/* test and save sign value along with absolute numeric value */ if SIGN(
ARG(1) ) <> '-1' then
   sign_character = ''
else
   sign_character = '-'
absolute_value = ABS( ARG(1) )
/* test for and save decimal value indicator */
decimal_position = POS( decimal, absolute_value )
if decimal_position = 0 then
   source = RIGHT( absolute_value, LENGTH(e1) - 1 ) || ' '
else
   source = RIGHT( LEFT( absolute_value, decimal_position - 1 ), LENGTH(e1)
- 1 ) || ' '
if decimal_position = 0 then
   edited_number =,
      STRIP( TRANSLATE( TRANSLATE( e2, source, e1), ',', ' '), 'B', ',')
else
   edited_number =,
      STRIP( TRANSLATE( TRANSLATE( e2, source, e1), ',', ' '), 'B', ','),
                      || RIGHT( absolute_value,,
                                LENGTH(absolute_value) - decimal_position +
1) return sign_character || edited_number
/*------------------------------------------------------------------------*\
|                                                                          |
|                Show precedence conflict in output listing                |
|                                                                          |
\*------------------------------------------------------------------------*/
LIST_SUPERCEDED_OCCURRENCES:
   Procedure expose,
      (GBL.list),
      search_order_stem.
parse arg search_order_subscript_list
superceding_subscript = WORD( search_order_subscript_list, 1 )
parse value search_order_stem.superceding_subscript with,
   superceding_file_date,
   superceding_file_time,
   superceding_file_size,
   superceding_file_attr,
   superceding_file_name_ext
superceding_file_name_ext = STRIP( superceding_file_name_ext )
output_line =,
   RIGHT( superceding_file_date , 8 )         || GBL.column_blanks ||,
   RIGHT( superceding_file_time , 6 )         || GBL.column_blanks ||,
   RIGHT( EDIT( superceding_file_size ), 10 ) || GBL.column_blanks ||,
   superceding_file_name_ext                  || GBL.column_blanks ||,
   ' supercedes:'
call LINEOUT GBL.output_file, output_line
GBL.output_line_count = GBL.output_line_count + 1
do sl = 2 to WORDS( search_order_subscript_list )
   prior_subscript = WORD( search_order_subscript_list, sl )
   parse value search_order_stem.prior_subscript with,
      prior_file_date,
      prior_file_time,
      prior_file_size,
      prior_file_attr,
      prior_file_name_ext
   prior_file_name_ext = STRIP( prior_file_name_ext )
   output_line =,
      RIGHT( prior_file_date, 8 )          || GBL.column_blanks ||,
      RIGHT( prior_file_time, 6 )          || GBL.column_blanks ||,
      RIGHT( EDIT( prior_file_size ), 10 ) || GBL.column_blanks ||,
      prior_file_name_ext
   call LINEOUT GBL.output_file, output_line
   GBL.output_line_count = GBL.output_line_count + 1
end
call LINEOUT GBL.output_file, ' '
GBL.output_line_count = GBL.output_line_count + 1
return
!tr! = VALUE('TRACE',,'OS2ENVIRONMENT'); if !tr! <> '' then do; TRACE(!tr!);
nop; end
/*------------------------------------------------------------------------*\
|                                                                          |
|                                End of Job                                |
|                                                                          |
\*------------------------------------------------------------------------*/
EOJ:
   Procedure
if ARG() = 0 then
   eoj_rc = 0
else
   eoj_rc = ARG(1)
elapsed_time = TIME('E')            /* get elapsed time - sssss.uuuuu */
parse value elapsed_time with seconds '.' micro_seconds
if SUBSTR( micro_seconds, 1, 1 ) >= 5 then
   seconds = seconds + 1
ss = FORMAT( seconds // 60, 2 )
minutes = ( seconds - ss ) / 60
mm = FORMAT( minutes // 60, 2 )
hh = FORMAT( ( minutes - mm ) / 60, 2 )
duration = hh':'mm':'ss
parse Source   . . program_path_and_name
program_name = TRANSLATE( FILESPEC( 'N', program_path_and_name ) ) say 'EOJ 
' program_name 'at' TIME('N') ||,
    ', duration' TRANSLATE( duration, '0', ' ' )
exit eoj_rc
/*------------------------------------------------------------------------*\
|                                                                          |
|                              Trap Routines                               |
|                                                                          |
\*------------------------------------------------------------------------*/
ERROR:       call TRAP_PROCESSING SIGL, 'ERROR',   RC
FAILURE:     call TRAP_PROCESSING SIGL, 'FAILURE', RC
HALT:        call TRAP_PROCESSING SIGL, 'HALT',    ''
LOGIC_ERROR: call TRAP_PROCESSING SIGL, 'LOGIC',   ARG(1)
NOVALUE:     call TRAP_PROCESSING SIGL, 'NOVALUE', ''
SYNTAX:      call TRAP_PROCESSING SIGL, 'SYNTAX',  RC
TRAP_PROCESSING:
   SIGNAL ON ERROR      name TRAP_DUMP_ROUTINE
   SIGNAL ON FAILURE    name TRAP_DUMP_ROUTINE
   SIGNAL ON HALT       name TRAP_DUMP_ROUTINE
   SIGNAL ON NOVALUE    name TRAP_DUMP_ROUTINE
   SIGNAL ON SYNTAX     name TRAP_DUMP_ROUTINE
   TRAP. = ''        /* Revised 97/04/23 - ANSI and/or VX-REXX enabled */
   /*---------------------*\
   |  Program path & name  |
   \*---------------------*/
   parse Source . . TRAP._path_and_program
   TRAP._line_nbr = ARG(1)
   if POS( ':', TRAP._path_and_program ) > 0 then
      /* get source line if it is available */
      do _T = 1
         trap_source_line._T =  SOURCELINE( TRAP._line_nbr )
         trap_source_line.0  = _T
         TRAP._line_nbr      = TRAP._line_nbr + 1
         if RIGHT( trap_source_line._T, 1 ) ª= ',' then
            do
               leave
            end
      end
   else
      /* program is running in macrospace */
      do
         TRAP._path_and_program = STRIP( DIRECTORY(), 'T', '\' ) || '\' ||,
                                 TRAP._path_and_program
         trap_source_line.1 = 'Source line is not available.'
         trap_source_line.0 = 1
      end
   parse value FILESPEC( 'N', TRAP._path_and_program ) with,
      TRAP._fn '.' TRAP._FE
   trap_file_name = FILESPEC( 'D', TRAP._path_and_program ) ||,
                    FILESPEC( 'P', TRAP._path_and_program ) ||,
                    TRAP._fn || '.' || 'DMP'
   /*-------------------------------------------*\
   |  Determine whether ANSII or VX-REXX output  |
   \*-------------------------------------------*/
   TRAP._gui = ( RxFuncQuery( 'VRWindow') = 0 )
   if TRAP._gui then
      do
         TRAP._gui = LEFT( VRWindow(), 1 ) = '?'
         TRAP._vxrexx_info = VRError()
         if TRAP._vxrexx_info = '' then
            do
               TRAP._vxrexx_info = '(none available)'
            end
      end
   /*------------------------------------------*\
   |  Check for reason not to create .DMP file  |
   \*------------------------------------------*/
   if ARG(2) = 'HALT' then
      do
         trap_file_name = ''
      end
   if RxFuncQuery( 'VARDUMP' ) <> 0 then
      do
         trap_file_name = ''
      end
   if POS( ':', trap_file_name ) = 0 then
      do
         trap_file_name = ''
      end
   /*------------------------*\
   |  Build trap message box  |
   \*------------------------*/
   dbl.h     = 'CD'x                 /* Í double line - horizontal   */
   dbl.v     = 'BA'x                 /* º double line - vertical     */
   dbl.bl    = 'C8'x                 /* È double line - bottom left  */
 
dbl.br
    = 'BC'x                 /* ¼ double line - bottom right */
 
dbl.tl
    = 'C9'x                 /* É double line - top left     */
 
dbl.tr
    = 'BB'x                 /* » double line - top right    */
   TRAP._red = '1B'x || '[1;37;41m'  /* bright white on red          */
   TRAP._dul = '1B'x || '[0m'        /* reset to normal              */
   TRAP._margin = COPIES( ' ', 5 )
   trap_error_description =,
      'Error line = ' || ARG(1) ||,
      '; ' ||,
      ARG(2) ||,
      ' trap.'
   if ARG(3) <> '' then
      trap_error_description = trap_error_description ||,
                               '  Return code = ' || ARG(3)
   _T=0
   _T=_T+1; TRAP._line._T = TRAP._fn'.'TRAP._FE
   _T=_T+1; TRAP._line._T = trap_error_description
   if trap_file_name <> '' then
      do
   _T=_T+1; TRAP._line._T = ''
   _T=_T+1; TRAP._line._T = 'See: ' || trap_file_name
      end
   _T=_T+1; TRAP._line._T = ''
   _T=_T+1; TRAP._line._T = 'Source line(s) at time of trap:'
   do _S = 1 to trap_source_line.0
      _T=_T+1; TRAP._line._T = TRAP._margin || trap_source_line._S
   end
          TRAP._line.0 = _T
   if TRAP._gui then
      do
         _T = _T+1; TRAP._line._T = ''
         _T = _T+1; TRAP._line._T = 'VX-REXX Error info: ' ||
TRAP._vxrexx_info
                    TRAP._line.0  = _T
         TRAP._PRIMARY_WINDOW_HANDLE = VRWindow()
         call VRSet  TRAP._PRIMARY_WINDOW_HANDLE,,
                     'BackColor',      'White',,
                     'ForeColor',      'Red',,
                     ''
         call VRMessageStem TRAP._PRIMARY_WINDOW_HANDLE,,
                            'TRAP._line.',,
                            CENTER( TRAP._fn 'fatal error', 74 ),,
                            'E'
      end
   else
      do
         TRAP.width = MAX( 74, LENGTH( trap_error_description ) )
         say TRAP._red || 
dbl.tl
 || COPIES( dbl.h,TRAP.width + 2 ) || 
dbl.tr
|| TRAP._dul
         say TRAP._red || dbl.v  || COPIES( ' ',  TRAP.width + 2 ) || dbl.v 
|| TRAP._dul
         do _T = 1 to TRAP._line.0
            say TRAP._red || dbl.v CENTER(TRAP._line._T, TRAP.width ) dbl.v 
|| TRAP._dul
         end
         say TRAP._red || dbl.v  || COPIES( ' ',  TRAP.width + 2 ) || dbl.v 
|| TRAP._dul
         say TRAP._red || dbl.bl || COPIES( dbl.h,TRAP.width + 2 ) || 
dbl.br
|| TRAP._dul
      end
   /*---------------------------------*\
   |  Create .DMP file if appropriate  |
   \*---------------------------------*/
   TRAP_DUMP_ROUTINE:
   if trap_file_name <> '' then
      do
         call SysFileDelete trap_file_name
         /* remove meaningless labels from dump for clarity */
         drop dbl. TRAP. RC RESULT SIGL !tr! _S _T
         call VARDUMP trap_file_name  /* write variables to program.DMP file
*/
      end
   exit 253
Attento alle righe che il mailer tronca e manda a capo!
--
-----------------------------------------------------------
Antonio(Nino) Scalisi           
sca...@tin.it
at 15:19(+0100, relative to GMT) on Wednesday, 23 Jan 2002
Using MR/2 ICE v2.30a  Reg: #20729.
Under ---> EcomStation + FixPACK1 + Kernel_UNI 14.086d
-----------------------------------------------------------

 This is a MIME encapsulated message.
