Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Johnny Lin wrote: > hi all, > > i was trying to find a routine that would tell me whether or not there > were any duplicate *.pro files defined among the directories in my > !PATH, and since i couldn't find one (though i found routines that were > similar in function) i thought i'd just write one. if you're interested > it's at: > > http://www.johnny-lin.com/idl_code/duplicate_pro.pro > > unfortunately it's only been tested on unix and doesn't look into the > files to find hidden utility routines (nor can it search for idl built-in > routines...if someone knows how to program that in, would be much obliged > for any help you could give) but just thought i'd mention it in case it's > of use to anyone. > > best, > -Johnny Dear Johnny here is my solution it should run on each platform. I am sorry it looks very short because we do prefer many small functions which could be used later on different projects too. The names are always choosen (hopefully) what's they are doing or what`s the result is. pro dupl f=file_search(expand_path(!path,/ARRAY),'*.pro') fpe=file_path_name_ext(f) result=arr_equal(fpe.name,/sort) print,result end The routines file_path_name_ext and arr_equal are from our library. I believe both are for others useful too. file_search is a replacement for findfile. You can found the help text by Bens help tool or in the whats new description. expand_path is the idl routine which expands pathes. http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/file_path_name_ext.tar.gz http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/arr_equal.tar.gz or as idl5.5 binary http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/file_path_name_ext.sav http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/arr_equal.sav For further routines and licensing please have a loot at. http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html best regards Reimar -- Forschungszentrum Juelich email: R.Bauer@fz-juelich.de http://www.fz-juelich.de/icg/icg-i/ ============================================================ ====== a IDL library at ForschungsZentrum Juelich http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
Dear Johnny If you are interested where are the routines which are duplicated you can add following lines ix=which_indices(fpe.name,result) print,fpe[ix].path+' -> '+fpe[ix].name http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/which_indices.tar.gz or as idl5.5 binary http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/which_indices.sav Reimar -- Forschungszentrum Juelich email: R.Bauer@fz-juelich.de http://www.fz-juelich.de/icg/icg-i/ ============================================================ ====== a IDL library at ForschungsZentrum Juelich http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
hi Reimar, thanks much for the help! best, -Johnny