* UnixFileSystemInfo.cs: rename Create() to GetFileSystemEntry(), and make
[mono.git] / mcs / class / Mono.Posix / Mono.Unix / UnixSymbolicLinkInfo.cs
index 360c2affe9ffd87a1341c62c30497b9b4a4d2c5d..868dade2d513fc6349c22e89ca3c29d8b9239e82 100644 (file)
@@ -49,13 +49,9 @@ namespace Mono.Unix {
                        get {return UnixPath.GetFileName (FullPath);}
                }
 
+               [Obsolete ("Use GetContents()")]
                public UnixFileSystemInfo Contents {
-                       get {
-                               string path = TryReadLink ();
-                               if (path != null)
-                                       return UnixFileSystemInfo.Create (ContentsPath);
-                               return null;
-                       }
+                       get {return GetContents ();}
                }
 
                public string ContentsPath {
@@ -70,9 +66,17 @@ namespace Mono.Unix {
                        }
                }
 
+               public UnixFileSystemInfo GetContents ()
+               {
+                       string path = ReadLink ();
+                       return UnixFileSystemInfo.GetFileSystemEntry (
+                                               UnixPath.Combine (UnixPath.GetDirectoryName (FullPath), 
+                                                       ContentsPath));
+               }
+
                public void CreateSymbolicLinkTo (string path)
                {
-                       int r = Native.Syscall.symlink (path, OriginalPath);
+                       int r = Native.Syscall.symlink (path, FullName);
                        UnixMarshal.ThrowExceptionForLastErrorIf (r);
                }
 
@@ -89,14 +93,6 @@ namespace Mono.Unix {
                        base.Refresh ();
                }
 
-               [CLSCompliant (false)]
-               [Obsolete ("Use SetOwner (long, long)", true)]
-               public override void SetOwner (uint owner, uint group)
-               {
-                       int r = Syscall.lchown (FullPath, owner, group);
-                       UnixMarshal.ThrowExceptionForLastErrorIf (r);
-               }
-
                public override void SetOwner (long owner, long group)
                {
                        int r = Native.Syscall.lchown (FullPath, Convert.ToUInt32 (owner), Convert.ToUInt32 (group));