Closed p5pRT closed 20 years ago
In a somewhat complex file structure\, Perl's glob() fails to find a lot of matches\, which are easily listed with e.g. tcsh's internal glob\, as the following example shows (note: my UNIX account is neither lmadmin nor in the lmadmin group\, see ls -l output below):
######## # first I list with tcsh. See the three stars in the glob? ######## $ ls -1dF /opt/lic/share/license/site/cadadm/*/*_lic* /opt/lic/share/license/site/cadadm/ads/ads_lic /opt/lic/share/license/site/cadadm/ads2002/ads2002_lic /opt/lic/share/license/site/cadadm/ads2002_eval/ads2002_eval_lic /opt/lic/share/license/site/cadadm/ads2002_eval/ads2002_eval_lic.8086075C@ /opt/lic/share/license/site/cadadm/ads_eval/ads_eval_lic /opt/lic/share/license/site/cadadm/advantest/advantest_lic /opt/lic/share/license/site/cadadm/ansoft_hfss/ansoft_hfss_lic /opt/lic/share/license/site/cadadm/ansys_5.7/ansys_5.7_lic /opt/lic/share/license/site/cadadm/aquarius/aquarius_lic /opt/lic/share/license/site/cadadm/aquarius_eval/aquarius_eval_lic /opt/lic/share/license/site/cadadm/aquarius_eval/aquarius_eval_lic.8086075c@ /opt/lic/share/license/site/cadadm/arc_eval/arc_eval_lic /opt/lic/share/license/site/cadadm/arc_metaware_eval/arc_metaware_eval_lic /opt/lic/share/license/site/cadadm/armads/armads_lic /opt/lic/share/license/site/cadadm/artwork/artwork_lic /opt/lic/share/license/site/cadadm/atrenta/atrenta_lic /opt/lic/share/license/site/cadadm/axys_maxsim/axys_maxsim_lic /opt/lic/share/license/site/cadadm/bindkey/bindkey_lic /opt/lic/share/license/site/cadadm/bindkey_eval/bindkey_eval_lic /opt/lic/share/license/site/cadadm/cats/cats_lic /opt/lic/share/license/site/cadadm/cds/cds_lic_file /opt/lic/share/license/site/cadadm/cds/cds_lic_file.8090c43d@ /opt/lic/share/license/site/cadadm/cds/cds_lic_file.8096260c@ /opt/lic/share/license/site/cadadm/cds/cds_lic_file.8318e7a9@ /opt/lic/share/license/site/cadadm/cds_eval/cds_eval_lic /opt/lic/share/license/site/cadadm/celoxica/celoxica_lic /opt/lic/share/license/site/cadadm/coware/coware_lic /opt/lic/share/license/site/cadadm/cve2/cve2_lic /opt/lic/share/license/site/cadadm/debussy/debussy_lic /opt/lic/share/license/site/cadadm/debussy_eval/debussy_eval_lic /opt/lic/share/license/site/cadadm/denali/denali_lic /opt/lic/share/license/site/cadadm/designplanner/designplanner_lic /opt/lic/share/license/site/cadadm/designsync/designsync_lic /opt/lic/share/license/site/cadadm/dolphin/dolphin_lic /opt/lic/share/license/site/cadadm/flexadmin/flexadmin_lic /opt/lic/share/license/site/cadadm/flomerics/flomerics_lic /opt/lic/share/license/site/cadadm/forte/forte_lic@ /opt/lic/share/license/site/cadadm/frame/frame_5.5_lic /opt/lic/share/license/site/cadadm/frame/frame_lic /opt/lic/share/license/site/cadadm/goepel/goepel_lic /opt/lic/share/license/site/cadadm/hsim_eval/hsim_eval_lic /opt/lic/share/license/site/cadadm/infineon/infineon_lic /opt/lic/share/license/site/cadadm/infineon_eval/infineon_eval_lic /opt/lic/share/license/site/cadadm/infineon_eval/infineon_eval_lic.8086075c@ /opt/lic/share/license/site/cadadm/innologic/innologic_lic /opt/lic/share/license/site/cadadm/lang/lang_lic@ /opt/lic/share/license/site/cadadm/lang2/lang2_lic@ /opt/lic/share/license/site/cadadm/lsf/lsf_lic /opt/lic/share/license/site/cadadm/magma/magma_lic /opt/lic/share/license/site/cadadm/magma_eval/magma_eval_lic /opt/lic/share/license/site/cadadm/magma_eval/magma_eval_lic.8086075c@ /opt/lic/share/license/site/cadadm/mathematica/mathematica_lic_4.0 /opt/lic/share/license/site/cadadm/matlab/matlab_lic /opt/lic/share/license/site/cadadm/mds_eval/mds_eval_lic /opt/lic/share/license/site/cadadm/mentor_8.2/mentor_8.2_lic /opt/lic/share/license/site/cadadm/mentor_8.2_dms/mentor_8.2_dms_lic /opt/lic/share/license/site/cadadm/mentor_8.2_eval/mentor_8.2_eval_lic /opt/lic/share/license/site/cadadm/mentor_8.2_eval/mentor_8.2_eval_lic.8086075c@ /opt/lic/share/license/site/cadadm/mentor_8.2_wan/mentor_8.2_wan_lic /opt/lic/share/license/site/cadadm/merlin/merlin_lic /opt/lic/share/license/site/cadadm/metrowerks/metrowks_lic /opt/lic/share/license/site/cadadm/mldesigner/mldesigner_lic /opt/lic/share/license/site/cadadm/muneda/muneda_lic /opt/lic/share/license/site/cadadm/muneda_eval/muneda_eval_lic /opt/lic/share/license/site/cadadm/ndrc/ndrc_lic /opt/lic/share/license/site/cadadm/prolific_eval/prolific_eval_lic /opt/lic/share/license/site/cadadm/raphael/raphael_lic /opt/lic/share/license/site/cadadm/rational/rational_lic /opt/lic/share/license/site/cadadm/saber_4.0/saber_4.0_lic /opt/lic/share/license/site/cadadm/sagantec/sagantec_lic /opt/lic/share/license/site/cadadm/sequence/sequence_lic /opt/lic/share/license/site/cadadm/sequence_eval/sequence_eval_lic /opt/lic/share/license/site/cadadm/sicat_32_eval/sicat_32_eval_lic /opt/lic/share/license/site/cadadm/sicat_64_eval/sicat_64_eval_lic /opt/lic/share/license/site/cadadm/sicat_yrs/sicat_yrs_lic /opt/lic/share/license/site/cadadm/signalscan/signalscan_lic /opt/lic/share/license/site/cadadm/simplex/simplex_lic /opt/lic/share/license/site/cadadm/snps/snps_lic /opt/lic/share/license/site/cadadm/snps_eval/snps_eval_lic /opt/lic/share/license/site/cadadm/solid/solid_lic /opt/lic/share/license/site/cadadm/sparcworks/sparcworks_lic /opt/lic/share/license/site/cadadm/specman/specman_lic /opt/lic/share/license/site/cadadm/specman_eval/specman_eval_lic /opt/lic/share/license/site/cadadm/specman_eval/specman_eval_lic.8086075c@ /opt/lic/share/license/site/cadadm/speed/speed_lic /opt/lic/share/license/site/cadadm/sunwspro_4.2/sunwspro_4.2_lic@ /opt/lic/share/license/site/cadadm/syncad/syncad_lic /opt/lic/share/license/site/cadadm/synopsys/synopsys_lic /opt/lic/share/license/site/cadadm/synopsys/synopsys_lic_tmp /opt/lic/share/license/site/cadadm/synplicity/synplicity_lic /opt/lic/share/license/site/cadadm/tcad/tcad_lic /opt/lic/share/license/site/cadadm/teaklite/teaklite_lic /opt/lic/share/license/site/cadadm/teaklite/teaklite_lic.8090c43d@ /opt/lic/share/license/site/cadadm/teradit/teradit_lic /opt/lic/share/license/site/cadadm/teradyne/teradyne_lic /opt/lic/share/license/site/cadadm/teradyne/teradyne_lic.8093ba8f /opt/lic/share/license/site/cadadm/tops/tops_lic /opt/lic/share/license/site/cadadm/undertow_eval/undertow_eval_lic /opt/lic/share/license/site/cadadm/vast/vast_lic /opt/lic/share/license/site/cadadm/viragelogic/viragelogic_lic /opt/lic/share/license/site/cadadm/virtuallogic/virtuallogic_lic /opt/lic/share/license/site/cadadm/vnavigator/vnavigator_lic /opt/lic/share/license/site/cadadm/vnavigator_eval/vnavigator_eval_lic /opt/lic/share/license/site/cadadm/vtip/vtip_lic /opt/lic/share/license/site/cadadm/wattwatcher/wattwatcher_lic /opt/lic/share/license/site/cadadm/windriver/windriver_lic /opt/lic/share/license/site/cadadm/xvw/xvw_lic
######## # now with Perl ######## $ /opt/perl_5.8.4/bin/perl -e 'print map {"$_\n"} glob("/opt/lic/share/license/site/cadadm/*/*_lic*")'
/opt/lic/share/license/site/cadadm/mentor_8.2/mentor_8.2_lic /opt/lic/share/license/site/cadadm/undertow_eval/undertow_eval_lic /opt/lic/share/license/site/cadadm/merlin/merlin_lic /opt/lic/share/license/site/cadadm/sequence_eval/sequence_eval_lic /opt/lic/share/license/site/cadadm/cds/cds_lic_file.8090c43d /opt/lic/share/license/site/cadadm/cds/cds_lic_file /opt/lic/share/license/site/cadadm/cds/cds_lic_file.8096260c /opt/lic/share/license/site/cadadm/cds/cds_lic_file.8318e7a9 /opt/lic/share/license/site/cadadm/coware/coware_lic /opt/lic/share/license/site/cadadm/celoxica/celoxica_lic /opt/lic/share/license/site/cadadm/speed/speed_lic /opt/lic/share/license/site/cadadm/synopsys/synopsys_lic /opt/lic/share/license/site/cadadm/synopsys/synopsys_lic_tmp
######## # I cannot see an obvious difference between a found and a # not-found directory (first was not found): ######## $ ls -la /opt/lic/share/license/site/cadadm/vnavigator_eval/ total 56 drwxr-sr-x 3 lmadmin lmadmin 4096 Mar 21 13:56 ./ drwxrwsr-x 110 lmadmin lmadmin 8192 May 4 18:23 ../ drwxr-s--- 2 lmadmin lmadmin 4096 Nov 12 2003 SAVE-TMP/ -rw-r----- 1 lmadmin lmadmin 532 Mar 21 13:51 vnavigator_eval.opt -rw-r--r-- 1 lmadmin lmadmin 2133 Nov 12 2003 vnavigator_eval_lic -rw-r----- 1 lmadmin lmadmin 2133 Nov 12 2003 vnavigator_eval_new
$ ls -la /opt/lic/share/license/site/cadadm/synopsys/ total 184 drwxr-sr-x 3 lmadmin lmadmin 4096 Mar 21 13:56 ./ drwxrwsr-x 110 lmadmin lmadmin 8192 May 4 18:23 ../ -rw-r----- 1 lmadmin lmadmin 147 Mar 19 2003 .la_dmon.opt -rw-r----- 1 lmadmin lmadmin 148 Mar 19 2003 .synopsys.opt -rw-r----- 1 lmadmin lmadmin 13249 Dec 1 09:25 .synopsys_lic drwxr-sr-x 2 lmadmin lmadmin 12288 Dec 1 09:25 SAVE-TMP/ -rw-r----- 1 lmadmin lmadmin 479 Mar 21 13:51 la_dmon.opt -rw-r----- 1 lmadmin lmadmin 480 Mar 21 13:51 synopsys.opt -rw-r--r-- 1 lmadmin lmadmin 12930 Mar 10 12:28 synopsys_lic -rw-r--r-- 1 lmadmin lmadmin 152 Dec 15 11:03 synopsys_lic_tmp -rw-r----- 1 lmadmin lmadmin 12930 Mar 1 16:07 synopsys_new
Marek Rouchal wrote on 14 May 2004 12:42:22:
In a somewhat complex file structure\, Perl's glob() fails to find a lot of matches\, which are easily listed with e.g. tcsh's internal glob\, as the following example shows (note: my UNIX account is neither lmadmin nor in the lmadmin group\, see ls -l output below):
Marek: The "note:..." has been a good hint. If you check the permissions of subdirectories in and below /opt/lic/share/license/site/cadadm\, you'll find at least one where you don't have access. In your mail I've seen this one:
$ ls -la /opt/lic/share/license/site/cadadm/vnavigator_eval/ drwxr-s--- 2 lmadmin lmadmin 4096 Nov 12 2003 SAVE-TMP/
If some directory cannot be opened due to permission denied\, File::Glob::bsd_glob exits immediately\, returning the unsorted results found up to this point; you might compare this with an unsorted ls of the directory. Also\, $! is set accordingly.
To get a behaviour that is identical to the shell\, EACCES must be ignored\, too\, in the bsd_glob error function.
Kind regards Wolfgang
The RT System itself - Status changed from 'new' to 'open'
LAUN Wolfgang wrote:
To get a behaviour that is identical to the shell\, EACCES must be ignored\, too\, in the bsd_glob error function.
Thanks\, applied as change #22823 to bleadperl.
--- ext/File/Glob/Glob.xs~ Fri Aug 23 00:59:49 2002 +++ ext/File/Glob/Glob.xs Sun May 16 08:47:01 2004
@rgs - Status changed from 'open' to 'resolved'
Wow - that exactly does the right job!
Thanks a lot\,
Marek
[laune - Mo 17. Mai. 2004\, 01:53:37]:
To get a behaviour that is identical to the shell\, EACCES must be ignored\, too\, in the bsd_glob error function.
Migrated from rt.perl.org#29581 (status was 'resolved')
Searchable as RT29581$