--- Steve Loughran <[EMAIL PROTECTED]> wrote: > Peter Reilly wrote: > > On 6/22/07, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > >> Author: mbenson > >> Date: Thu Jun 21 20:10:20 2007 > >> New Revision: 549684 > >> > >> URL: > http://svn.apache.org/viewvc?view=rev&rev=549684 > >> Log: > >> detect cs > >> > >> Modified: > >> > ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java > >> > >> Modified: > >> > ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java > >> URL: > >> > http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?view=diff&rev=549684&r1=549683&r2=549684 > > >> > >> > ============================================================================== > > >> > >> --- > ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java > > >> (original) > >> +++ > ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java > > >> Thu Jun 21 20:10:20 2007 > >> @@ -15,7 +15,6 @@ > >> * limitations under the License. > >> * > >> */ > >> - > >> package org.apache.tools.ant.util; > >> > >> import java.io.File; > >> @@ -62,10 +61,13 @@ > >> private static Random rand = new > Random(System.currentTimeMillis() > >> + > Runtime.getRuntime().freeMemory()); > >> > >> - private static boolean onNetWare = > Os.isFamily("netware"); > >> - private static boolean onDos = > Os.isFamily("dos"); > >> - private static boolean onWin9x = > Os.isFamily("win9x"); > >> - private static boolean onWindows = > Os.isFamily("windows"); > >> + private static final boolean onNetWare = > Os.isFamily("netware"); > >> + private static final boolean onDos = > Os.isFamily("dos"); > >> + private static final boolean onWin9x = > Os.isFamily("win9x"); > >> + private static final boolean onWindows = > Os.isFamily("windows"); > >> + private static final boolean onMac = > Os.isFamily("mac"); > >> + > >> + private static boolean > caseSensitiveFileSystem; > >> > >> static final int BUF_SIZE = 8192; > >> > >> @@ -87,6 +89,23 @@ > >> */ > >> public static final long > NTFS_FILE_TIMESTAMP_GRANULARITY = 1; > >> > >> + static { > >> + try { > >> + File tmpdir = new > File(System.getProperty("java.io.tmpdir")); > >> + final String filename = > "ant-casesensitivity.tst"; > >> + new File(tmpdir, > filename).createNewFile(); > >> + new File(tmpdir, > filename.toUpperCase()).createNewFile(); > >> + String[] files = tmpdir.list(new > FilenameFilter() { > >> + public boolean accept(File dir, > String name) { > >> + return > filename.equalsIgnoreCase(name); > >> + } > >> + }); > >> + caseSensitiveFileSystem = > files.length == 2; > >> + } catch (IOException e) { > >> + //default as well as possible: > >> + caseSensitiveFileSystem = !onWin9x > && !onWindows && > >> !onDos && !onMac; > >> + } > >> + } > >> > > Do we really want to do this each time ANT starts > up? > > Also, on Unix, one may have a mixture of > filesystems, some of > > which are case insensitive and some (well nearly > all) not. > > These may be mounted or symbolically linked to the > anywhere in > > the directory tree. > > > > > Windows goes case sensitive if you mount samba FS or > use clearcase. so > its a directory-by-directory feature
Good point. Guess I will revert; I just hate doing all these massive mods I'm working on with test failures, and I suppose we can call it a bug in the OS X JVM that files "foo" and "FOO" are considered non-equal on a non-cs fs. WinXP, in contrast, says the files are equal. Having only had my MBP for a short while, I wasn't even aware the fs was non-cs until yesterday. I was kind of disappointed but from what I see on the web I might end up sorry if I convert to the cs fs from an app interoperability perspective. The fact remains we need a workaround for this bug on non-cs filesystems where the JVM can't give us the accurate info that "foo" and "FOO" are equal. Does anyone have any better ideas? :( -Matt > > -steve > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ____________________________________________________________________________________Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]