SourceForge has been redesigned. Learn more.
Close

#3207 [file rootname] failure

obsolete: 8.5a3
closed-fixed
5
2005-08-09
2005-08-09
Aric
No

When the result of a call to [glob]* is stored in a
variable, and then [file rootname] is performed on any
list element stored in that variable, [file rootname]
fails to remove the file extension of the list element.

The following script demonstrates the error (pathnames
may need to be adjusted):

# the following fails
set files [glob d:/temp/p*]
foreach file $files {
puts [file rootname $file]
}

# the following succeeds
foreach file [glob d:/temp/p*] {
puts [file rootname $file]
}

# the following fails
foreach file [lsort -dictionary [glob d:/temp/p*]] {
puts [file rootname $file]
}

*Donal Fellows notes on c.l.t. :

"the directory must be specified (either in the pattern
or through the -directory flag) and 'glob characters'
must be present in the input to [glob] to trigger the bug."

Discussion

  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Err, it was already fixed by the time you submitted the bug. :^)

     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
  • Aric

    Aric - 2005-08-09

    Logged In: YES
    user_id=1326110

    Now that's service! Many thanks.