public static bool TryGetGVFSEnlistmentRootImplementation(string directory, string dotGVFSRoot, out string enlistmentRoot, out string errorMessage)
        {
            enlistmentRoot = null;

            string finalDirectory;

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

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

            return(true);
        }
Beispiel #2
0
        public static bool TryGetGVFSEnlistmentRootImplementation(string directory, out string enlistmentRoot, out string errorMessage)
        {
            // TODO(POSIX): Merge this code with the implementation in WindowsPlatform

            enlistmentRoot = null;

            string finalDirectory;

            if (!POSIXFileSystem.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);
        }
Beispiel #3
0
 public bool TryGetNormalizedPath(string path, out string normalizedPath, out string errorMessage)
 {
     return(POSIXFileSystem.TryGetNormalizedPathImplementation(path, out normalizedPath, out errorMessage));
 }