return fullpath;
}
+ internal static String GetFullPathInternal(String path)
+ {
+ return InsecureGetFullPath (path);
+ }
+
#if !MOBILE
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364963%28v=vs.85%29.aspx
[DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static string WindowsDriveAdjustment (string path)
{
- // two special cases to consider when a drive is specified
- if (path.Length < 2)
+ // three special cases to consider when a drive is specified
+ if (path.Length < 2) {
+ if (path.Length == 1 && (path[0] == '\\' || path[0] == '/'))
+ return Path.GetPathRoot(Directory.GetCurrentDirectory());
return path;
+ }
if ((path [1] != ':') || !Char.IsLetter (path [0]))
return path;
f = new FileStream (path, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.Read,
8192, false, (FileOptions) 1);
} catch (IOException ex){
- if (ex.hresult != MonoIO.FileAlreadyExistsHResult || count ++ > 65536)
+ if (ex._HResult != MonoIO.FileAlreadyExistsHResult || count ++ > 65536)
throw;
} catch (UnauthorizedAccessException ex) {
if (count ++ > 65536)
throw new ArgumentException (parameterName);
}
}
+
+ internal static string DirectorySeparatorCharAsString {
+ get {
+ return DirectorySeparatorStr;
+ }
+ }
}
}