Ejemplo n.º 1
0
        public NtStatus MoveFile(string oldName, string newName, bool replace, DokanFileInfo info)
        {
            if (!HasAccess(info))
            {
                return(DokanResult.AccessDenied);
            }

            if (ReadOnly)
            {
                return(DokanResult.AccessDenied);
            }

            try
            {
                Wait(provider.MoveFile(oldName, newName, replace));
                Log.Trace("Move file:" + oldName + " - " + newName);

                return(DokanResult.Success);
            }
            catch (AggregateException ex) when(ex.InnerException is TimeoutException)
            {
                Log.Error(ex);
                return(NtStatus.Timeout);
            }
            catch (Exception e)
            {
                Log.Error(e);
                return(DokanResult.Error);
            }
        }
Ejemplo n.º 2
0
 public async Task MoveFile(string oldPath, string newPath, bool replace) => await provider.MoveFile(FixRoot(oldPath), FixRoot(newPath), replace).ConfigureAwait(false);