mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Copy/Move/Hardlink/Symlink to same file
This commit is contained in:
parent
28fe1bfdca
commit
c95c005cd3
4 changed files with 8 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ implementation
|
|||
|
||||
|
||||
uses
|
||||
uLng, uGlobs, uLog, uShowMsg, uOSUtils;
|
||||
FileUtil, uLng, uGlobs, uLog, uShowMsg, uOSUtils;
|
||||
|
||||
function ShowHardLinkForm(const sNew, sDst:String): Boolean;
|
||||
begin
|
||||
|
|
@ -52,6 +52,7 @@ begin
|
|||
inherited;
|
||||
sSrc:=edtNew.Text;
|
||||
sDst:=edtDst.Text;
|
||||
if CompareFilenames(sSrc, sDst) = 0 then Exit;
|
||||
if CreateHardLink(sSrc, sDst) then
|
||||
begin
|
||||
// write log
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function ShowSymLinkForm(const sNew, sDst:String): Boolean;
|
|||
implementation
|
||||
|
||||
uses
|
||||
uLng, uGlobs, uLog, uShowMsg, uOSUtils;
|
||||
FileUtil, uLng, uGlobs, uLog, uShowMsg, uOSUtils;
|
||||
|
||||
function ShowSymLinkForm(const sNew, sDst:String): Boolean;
|
||||
begin
|
||||
|
|
@ -50,6 +50,7 @@ begin
|
|||
inherited;
|
||||
sSrc:=edtNew.Text;
|
||||
sDst:=edtDst.Text;
|
||||
if CompareFilenames(sSrc, sDst) = 0 then Exit;
|
||||
if CreateSymLink(sSrc, sDst) then
|
||||
begin
|
||||
// write log
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ type
|
|||
|
||||
implementation
|
||||
uses
|
||||
LCLProc, SysUtils, Classes, StrUtils, uLng, uGlobs, uLog, uShowMsg, uFileProcs, uFindEx,
|
||||
LCLProc, SysUtils, Classes, StrUtils, FileUtil, uLng, uGlobs, uLog, uShowMsg, uFileProcs, uFindEx,
|
||||
uDCUtils, uOSUtils, uClassesEx, uDescr;
|
||||
|
||||
procedure TCopyThread.MainExecute;
|
||||
|
|
@ -101,6 +101,7 @@ begin
|
|||
if sDstExt<>'.' then
|
||||
sDstNew:= sDstNew+sDstExt;
|
||||
// DebugLn(sDstNew);
|
||||
if CompareFilenames(fr^.sName, sDst+fr^.sPath+sDstNew) = 0 then Exit(False);
|
||||
FFileOpDlg.sFileName:= ExtractFileName(fr^.sName)+' -> '+fr^.sPath+sDstNew;
|
||||
Synchronize(@FFileOpDlg.UpdateDlg);
|
||||
if FPS_ISLNK(fr^.iMode) then
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ type
|
|||
|
||||
implementation
|
||||
uses
|
||||
uFileProcs, SysUtils, uShowMsg, uLng, uGlobs, uLog, uDCUtils, uOSUtils;
|
||||
uFileProcs, SysUtils, FileUtil, uShowMsg, uLng, uGlobs, uLog, uDCUtils, uOSUtils;
|
||||
|
||||
|
||||
procedure TMoveThread.MainExecute;
|
||||
|
|
@ -80,6 +80,7 @@ begin
|
|||
sDstNew:=sDstName;
|
||||
if sDstExt<>'.' then
|
||||
sDstNew:=sDstNew+sDstExt;
|
||||
if CompareFilenames(pr^.sName, sDstPath+pr^.sPath+sDstNew) = 0 then Continue;
|
||||
FFileOpDlg.sFileName:=ExtractFileName(pr^.sName)+' -> '+pr^.sPath+sDstNew;
|
||||
Synchronize(@FFileOpDlg.UpdateDlg);
|
||||
// test if exists and show dialog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue