Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 917cef44f45953b92a4c1bee7b6eaf7c8e289dad
Ticket: 1146047fffffffffffffffffffffffffffffffff
Unexpected [glob] result, when match is partly inaccessable
User & Date: matzek on 2005-02-22 08:16:35
Changes

  1. assignee changed to: "vincentdarley"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    [glob] is documented to behave like csh globbing, with
    only two exceptions. The first (sorting) is not
    relevant, the second says [glob] returns only existing
    files. It might or might not be relevant, I can't tell...
    
    The situation:
    
    1) let me show how csh behaves on my Linux box and
    therefore what I expected [glob] to return:
    
      makr@pcmakr1:~> csh
      /home/makr> ls -l / | grep '[rb]oot$'
      drwxr-xr-x    4 root     root         1024 2004-12-22
    13:19 boot
      drwx------   17 root     root          832 2005-01-24
    08:33 root
      /home/makr> echo /[rb]oot/*
      /boot/System.map-2.4.20-4GB /boot/System.org
    /boot/boot /boot/boot.0800 /boot/grub /boot/initrd
    /boot/initrd.org /boot/initrd.shipped /boot/lost+found
    /boot/map /boot/memtest.bin /boot/message
    /boot/vmlinux.gz /boot/vmlinuz /boot/vmlinuz.autoconf.h
    /boot/vmlinuz.config /boot/vmlinuz.org
    /boot/vmlinuz.shipped /boot/vmlinuz.version.h
    
    2) trying to use [glob] this way, however, gives me
    either an error (a) or nothing (b):
    
    a)
    
      (makr) 53 % glob -- {/[rb]oot/*}
      couldn't read directory "/root/": permission denied
    
    b)
    
      (makr) 54 % glob -nocomplain -- {/[rb]oot/*}
      (makr) 55 % 
    
    Tcl version:
      (makr) 52 % set tcl_patchLevel
      8.4.9
    
    To me the behavior in (a) is wrong as the documentation
    makes me expect another result. The result of (b),
    however, is also odd, when (a) is deemed as "works as
    designed". After all, there might be cases, when it
    might be good to know the pattern matches partly
    inaccessable file system parts. On the other hand, if I
    just want a list of accessable files this behavior
    complicates life unneccessarily...
    
    kind regards
    -- Matthioas Kraft
    
  4. foundin changed to: "obsolete: 8.4.9"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "matzek"
  9. subsystem changed to: "37. File System"
  10. title changed to:
    Unexpected [glob] result, when match is partly inaccessable
    
  11. type changed to: "Bug"