How does setup.exe handle duplicate files?

Jason Tishler
Fri Jun 9 09:19:00 GMT 2000

Chris Faylor wrote:
> On Fri, Jun 09, 2000 at 11:40:59AM -0400, DJ Delorie wrote:
> >> Does setup.exe handle duplicate files correctly?  To be explicit, if
> >> more than one tar.gz archive contain a file with the same name, does
> >> setup.exe install the correct one?
> >
> >No, it just randomly picks one.  As of setup 1.48, though, it should
> >install all files writable so that this problem is avoided.
> Actually previous versions of setup install files as writable, also.

Unfortunately, I'm still concerned that setup may not install the
correct file because the extraction is dependent on the order in
which tar.gz files are found.  From setup.c, we have:

    recurse_dirs (...)
        pattern = pathcat (dir, "*.gz");
        handle = FindFirstFile (pattern, &find_data);
            if (!tarx (dir, find_data.cFileName))
        while (FindNextFile (handle, &find_data));

If I understand the above code, then in the case of a duplicate file,
foo, the foo that is extracted last will be the one that is installed.
Hence, "correctness" is solely determined by the enumeration order of
FindFirstFile()/FindNextFile().  I don't see how this policy guarantees
that the correct instance of a duplicate file is always installed.


Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation         Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email:
Hazlet, NJ 07730 USA                 WWW:

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list