* UnixFileSystemInfo.cs: Create() should return a UnixFileInfo if the file
authorJonathan Pryor <jpryor@novell.com>
Thu, 23 Feb 2006 16:08:06 +0000 (16:08 -0000)
committerJonathan Pryor <jpryor@novell.com>
Thu, 23 Feb 2006 16:08:06 +0000 (16:08 -0000)
commitdd48eb312b001b9e4a412abd737f3daa4c5abbbc
tree23b6e42b13c51d281feb93307bbbbf35b7b8aaa4
parent5cb439896744cd4b9ad44f53628efbd7130cbabe
  * UnixFileSystemInfo.cs: Create() should return a UnixFileInfo if the file
    doesn't exist.  This allows callers to use UnixFileInfo.Exists to see if
    the file exists, and behaves more rationally e.g. if the directory
    contents changes while calling UnixDirectoryInfo.GetFileSystemEntries(),
    we'll get a UnixFileInfo entry that doesn't exist instead of an exception
    terminating the entire array creation.
  * UnixSymbolicLinkInfo.cs: [Obsolete] the Contents property -- this property
    *always* creates a new object if HasContents=true, and since a
    UnixFileSystemInfo instance is (104+2*(sizeof(void*))+1) bytes (~113 bytes
    on 32-bit platforms), we don't want to create these frequently.  Add a
    GetContents() method as the replacement, to make it (slightly) more
    explicit that information won't be cached (and thus should be cached by
    the caller, if appropriate).  GetContents() throws an exception if
    HasContents=false instead of returning null; this change brings the
    implementation in line with the documentation.

svn path=/trunk/mcs/; revision=57206
mcs/class/Mono.Posix/Mono.Unix/ChangeLog
mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs
mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs