Esempio n. 1
0
        private static bool TryGetGVFSEnlistmentRootImplementation(string directory, out string enlistmentRoot, out string errorMessage)
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                return(POSIXPlatform.TryGetGVFSEnlistmentRootImplementation(directory, out enlistmentRoot, out errorMessage));
            }

            // Not able to use WindowsPlatform here - because of its dependency on WindowsIdentity (and also kernel32.dll).
            enlistmentRoot = null;

            string finalDirectory;

            if (!WindowsFileSystem.TryGetNormalizedPathImplementation(directory, out finalDirectory, out errorMessage))
            {
                return(false);
            }

            enlistmentRoot = Paths.GetRoot(finalDirectory, GVFSConstants.DotGVFS.Root);
            if (enlistmentRoot == null)
            {
                errorMessage = $"Failed to find the root directory for {GVFSConstants.DotGVFS.Root} in {finalDirectory}";
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        private static string GetNamedPipeNameImplementation(string enlistmentRoot)
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                return(POSIXPlatform.GetNamedPipeNameImplementation(enlistmentRoot));
            }

            // Not able to use WindowsPlatform here - because of its dependency on WindowsIdentity (and also kernel32.dll).
            return("GVFS_" + enlistmentRoot.ToUpper().Replace(':', '_'));
        }
Esempio n. 3
0
 public static bool IsElevated()
 {
     return(POSIXPlatform.IsElevatedImplementation());
 }
Esempio n. 4
0
 public static bool IsConsoleOutputRedirectedToFile()
 {
     return(POSIXPlatform.IsConsoleOutputRedirectedToFileImplementation());
 }
Esempio n. 5
0
 public static bool IsProcessActive(int processId)
 {
     return(POSIXPlatform.IsProcessActiveImplementation(processId));
 }
Esempio n. 6
0
 public static string GetNamedPipeNameImplementation(string enlistmentRoot)
 {
     return(POSIXPlatform.GetNamedPipeNameImplementation(enlistmentRoot, DotGVFSRoot));
 }
Esempio n. 7
0
 public static bool TryGetGVFSEnlistmentRootImplementation(string directory, out string enlistmentRoot, out string errorMessage)
 {
     return(POSIXPlatform.TryGetGVFSEnlistmentRootImplementation(directory, DotGVFSRoot, out enlistmentRoot, out errorMessage));
 }