Tk Library Source Code

View Ticket
Login
Ticket UUID: 1526641
Title: find mishandles "hidden" files on Win
Type: Bug Version: None
Submitter: blacksqr Created on: 2006-07-21 18:50:28
Subsystem: fileutil Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2007-08-09 02:47:51
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2007-08-08 19:47:51
Description:
fileutil::find has two separate implementations for
Windows and Unix... the Windows implementation
incorrectly uses a glob pattern intended for Unix which
assumes that filenames starting with "." need explicit
matching, leading to files so named being listed twice
in the result.

In the Windows implementation, the line:

    set filenames [glob -nocomplain * .*]

should be:

    set filenames [glob -nocomplain *]

####
fileutil version 1.6.1
User Comments: andreas_kupries added on 2007-08-09 02:47:51:
Logged In: YES 
user_id=75003
Originator: NO

This should be fixed by the recent rewrite of fileutil::find which is now in the CVS head.

blacksqr added on 2006-07-23 01:35:22:
Logged In: YES 
user_id=128673

The above suggested change excludes hidden files on Windows;
the below line could be used in both the Windows and Unix
implementations of find:

replace 

 set filenames [glob -nocomplain * .*]

with:

 set filenames [glob -nocomplain *] ; set filenames [concat
$filenames [glob -nocomplain -types hidden *]]

Note how much easier this whole problem would be if there
were a "-types all" option provided by glob.