Tk Library Source Code

View Ticket
Login
Ticket UUID: 1098039
Title: fileutil::find lists files that start with . twice
Type: Bug Version: None
Submitter: nobody Created on: 2005-01-07 17:48:27
Subsystem: fileutil Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-02-12 15:22:26
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2005-02-12 08:22:26
Description:
TCL version: 2.4.9
Platform:     WIN2K SP4
tcllib:         1.7

In the course of writing a script on the win2k
platform, I've
come across a bug in the implementation of fileutil::find

I'm not sure if it's an issue under *unix, but I
suspect it is...

If a directory has a file that starts with a . (like
.splintrc)
then fileutil::find will list it twice!

To reproduce:

1. Create a clean directory
2. Start a tcl shell, and go to that dir
3. package require fileutil
4. fileutil::touch .splintrc
5. fileutil::find .

the .splintrc file is listed twice

The implementation of find in tcllib uses [glob
-nocomplain * .*]
which explains the problem.

It might be better to use [glob nocomplain *] as
Windows does not
see the . and .. anyways.

I suspect the problem may be there under *unix as well,
so the
search pattern may be better expressed as [glob
-nocomplain * . ..]

Ralph
User Comments: andreas_kupries added on 2005-02-12 15:22:26:
Logged In: YES 
user_id=75003

Fixed in the CVS head. List of glob patterns is defined
platform dependent now.