FIX: Copy/Move/Hardlink/Symlink to same file

This commit is contained in:
Alexander Koblov 2009-02-28 13:52:28 +00:00
commit c95c005cd3
4 changed files with 8 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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