[Mono-list] ASP.NET on Mac OS X

steve@mudflapsoftware.com steve@mudflapsoftware.com
Sun, 8 Feb 2004 16:03:16 -0800


The biggest problem is that the place the exception is thrown is in managed
code. System.IO doesn't natively provide support for the unique
identification of files, whether it be inode or whatever.

As a workaround, I patched the code to do the following.. (pseudo code)

if (web.config and Web.config exist)
{
    FileStream fs1 = File.OpenWrite(web.config)
    try
    {
        FileStream fs2 = File.OpenWrite(Web.config)
        fs2.close()
        return files_are_different;
    }
    catch(Exception ex)
    {
        return files_are_the_same;
    }
    fs1.close
}

This workaround should be a bit more robust and check the file contents as
well, as it is possible that an exclusive lock was placed on Web.config
before entering the inner try/catch.

I wasn't gonna submit the code as a patch because it is more of a workaround
than a 'perfect fix'.... but if someone wants the code, let me know.

----- Original Message ----- 
From: "Jonathan LaCour" <panix-lists@skinnee.net>
To: "Dan Winship" <danw@ximian.com>
Cc: "Jackson Harper" <jackson@ximian.com>; "mono-list"
<mono-list@ximian.com>
Sent: Sunday, February 08, 2004 9:52 AM
Subject: Re: [Mono-list] ASP.NET on Mac OS X


> On Feb 8, 2004, at 12:28 PM, Dan Winship wrote:
> > That's a property of the filesystem though, not the OS. OS X does let
> > you have UFS or case-sensitive HFS partitions (and OS X Server defaults
> > to using a case-sensitive filesystem).
> >
> > If this were a POSIX C program, I'd say that you should stat() both
> > files and only throw the exception if they have the same st_ino. But I
> > don't know if you can translate that into C#/.Net.
>
> I didn't even think of that.  You are correct, knowing that you are on
> Mac OS X actually doesn't fix the problem.  We need to manually check
> to see if they are the same file.  My bug probably should be updated to
> take this into account.
>
> I will dig around a bit in corlib to see if there is any way for us to
> programmatically determine if the files are the same.
>
>   - Jon
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>