New test.
[mono.git] / mcs / class / corlib / System.IO / MonoIO.cs
index 51d634a5df6a06accc5eb96a6ee726d01b88fea4..21c21b236c99a17c83d9eda1879e7ad9050f716f 100644 (file)
@@ -114,6 +114,9 @@ namespace System.IO
                        case MonoIOError.ERROR_DIR_NOT_EMPTY:
                                message = String.Format ("Directory {0} is not empty", path);
                                return new IOException (message, unchecked((int)0x80070000) | (int)error);
+
+                       case MonoIOError.ERROR_ENCRYPTION_FAILED:
+                               return new IOException ("Encryption failed", unchecked((int)0x80070000) | (int)error);
                                
                        default:
                                message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path);
@@ -205,6 +208,20 @@ namespace System.IO
                        return true;
                }
 
+               public static bool ExistsSymlink (string path,
+                                                 out MonoIOError error)
+               {
+                       FileAttributes attrs = GetFileAttributes (path,
+                                                                 out error);
+                       if (attrs == InvalidFileAttributes)
+                               return false;
+                       
+                       if ((attrs & FileAttributes.ReparsePoint) == 0)
+                               return false;
+
+                       return true;
+               }
+
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                public extern static bool GetFileStat (string path,
                                                       out MonoIOStat stat,
@@ -217,7 +234,7 @@ namespace System.IO
                                                  FileMode mode,
                                                  FileAccess access,
                                                  FileShare share,
-                                                 bool async,
+                                                 FileOptions options,
                                                  out MonoIOError error);
                
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
@@ -308,7 +325,7 @@ namespace System.IO
 
                        handle = Open (path, FileMode.Open,
                                       FileAccess.ReadWrite,
-                                      FileShare.ReadWrite, false, out error);
+                                      FileShare.ReadWrite, FileOptions.None, out error);
                        if (handle == MonoIO.InvalidHandle)
                                return false;