Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs')
-rw-r--r--mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs18
1 files changed, 7 insertions, 11 deletions
diff --git a/mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs b/mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs
index b469af311e3..93b1bfeddb9 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs
+++ b/mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs
@@ -49,9 +49,13 @@ namespace Mono.Unix {
get {return UnixPath.GetFileName (FullPath);}
}
- [Obsolete ("Use GetContents()")]
public UnixFileSystemInfo Contents {
- get {return GetContents ();}
+ get {
+ string path = TryReadLink ();
+ if (path != null)
+ return UnixFileSystemInfo.Create (ContentsPath);
+ return null;
+ }
}
public string ContentsPath {
@@ -66,17 +70,9 @@ namespace Mono.Unix {
}
}
- public UnixFileSystemInfo GetContents ()
- {
- string path = ReadLink ();
- return UnixFileSystemInfo.Create (
- UnixPath.Combine (UnixPath.GetDirectoryName (FullPath),
- ContentsPath));
- }
-
public void CreateSymbolicLinkTo (string path)
{
- int r = Native.Syscall.symlink (path, FullName);
+ int r = Native.Syscall.symlink (path, OriginalPath);
UnixMarshal.ThrowExceptionForLastErrorIf (r);
}