Ejemplo n.º 1
0
        private void EnsureParentDirExist(string path)
        {
            string parent_dir = GetUnixDirectoryName(path);

            if (null == GetAttributes(parent_dir))
            {
                _sftpSession.RequestMkDir(parent_dir);
            }
        }
Ejemplo n.º 2
0
        DokanError IDokanOperations.CreateDirectory(string fileName, DokanFileInfo info)
        {
            Log("CreateDir:{0}", fileName);


            try
            {
                _sftpSession.RequestMkDir(GetUnixPath(fileName));
                InvalidateParentCache(fileName); //invalidate dircahe of the parent
            }
            catch (SftpPermissionDeniedException)
            {
                return(DokanError.ErrorAccessDenied);
            }
            catch (SshException) // operation should fail with generic error if file already exists
            {
                return(DokanError.ErrorAlreadyExists);
            }

            return(DokanError.ErrorSuccess);
        }