I don't have it anymore but the code was a custum function, that wrapped around
the win api for the file copy process.
back when I used windows 95 I tinkered with Delphi 3, and remember doing something simular
so I was merley playing around with CopyFile() on my linux machine and discovered that it is
not viable to use for large files. Because you can not deligate the progress of the operation.
I figured instead of 23 lines of code I could simplify and downsize to 6 lines of code, to help
make my programs file size smaller lol.
im currently using TProcess and piping the output through pv, and works great I was just currious
if I could shorten my code to use the system copy dialog rather then having to create my own

hProcess := TProcess.Create(nil);
hProcess.Executable := '/bin/sh';
hprocess.Parameters.Add('-c');
hprocess.Parameters.add('pv -pf ' + srcFile + ' | dd of=' + srcTarget +' bs=512k');
hProcess.Options := hProcess.Options + [PoUsePipes, poStderrToOutPut];
hProcess.Execute;
xData := TStringList.Create;
while (hProcess.Running) or (hProcess.Active) do
begin
application.ProcessMessages;
xData.LoadFromStream(hProcess.Output);
fPOS := POS(']',xData[0]);
sPOS := POS('%',xData[0]);
if fPOS <> 0 then
begin
sData := Copy(xData[0],fPos + 1 , sPos - fPos - 1);
lblProgressPercent.Caption := sData + '%';
// I always found using a shape componient works great for a progress bar substitute.
// Multiplied by 5 because the width is 500
ProgressBar.Width := StrToInt(sData) * 5 ;
end;
end;
hProcess.free;
xData.Free;
if hProcess.Running = false then
begin
// do sumthing here etc calculate md5 hash on file etc
runcommand('/bin/sh',['-c','pv -pf ' + srcTarget + ' | md5sum'],NewData);
end;
end;