ho trovato questa cosina..... in pratica è in pascal e io non ci capisco nulla

uses ATAPI;
type PCDMode=^TCDMode;
TCDMode=record
Header:TModeParametersHeader;
PSPageCode:byte; {PS bit 7}
{PageCode bits 0-6}
PageLength:byte; {=$32}
TestFlagWriteType:byte; {TestFlag bit 4}
{Write type bits 0-3}
MSFPCopyTrackMode:byte; {MS (Multisession) bits 6-7}
{FP bit 5}
{Copy bit 4}
{Track mode bits 0-3}
DataBlockType:byte; {bits 0-3}
Reserved1:array[1..2] of byte;
HostApplicationCode:byte; {bits 0-5}
SessionFormat:byte;
Reserved2:byte;
PacketSize:longint;
AudioPauseLength:word;
MCVAL:byte; {bit 7}
MediaCatalogNumber:array[1..13] of byte;
ZeroMC:byte;
AFRAMEMC:byte; {=$00}
TCVAL:byte; {bit 7}
CountryCode:byte;
InternationalStandardRecordingCode:byte;
OwnerCode:array[1..3] of byte;
YearOfRecording:word;
SerialNumber:array[1..5] of byte;
ZeroTC:byte;
AFRAMETC:byte;
Reserved3:byte;
SubHeader:array[0..3] of byte;
end;
var Dev:PATAPIDevice;
TOC:PTOC;
Size:word;
WriteBlocks,StartWrite:longint;
Data:PWordArray;
imagef:file;
ch:char;
begin
Assign(imagef,Paramstr(1));
{$I-}
Reset(imagef,1);
{$I+}
if IOResult<>0 then
begin
writeln('Image file: ',Paramstr(1),' not found.');
exit;
end;
if (Filesize(imagef)mod 2048)>0 then
begin
writeln('The size of the image-file is not correct.');
writeln('Image file seems to be corrupt, abort ...');
close(imagef);
exit;
end;
WriteBlocks:=FileSize(imagef) div 2048;
if (WriteBlocks=0) then
begin
writeln('Size of image file is zero, hmm...');
close(imagef);
exit;
end;
Dev:=New(PATAPIDevice,Init(DRV_SLAVE,1,RESET_DRIVE));
Getmem(Data,MAX_SENSEBUFFER);
Dev^.ModeSense(0,$05,Data^,Size);
with PCDMode(Data)^ do
begin
TestFlagWriteType:=$00+$01;
MSFPCopyTrackMode:=0+0+0+4;
DataBlockType:=$08;
HostApplicationCode:=0;
SessionFormat:=0;
PacketSize:=0;
AudioPauseLength:=BigEndianWord(0);
FillChar(MediaCatalogNumber,Sizeof(MediaCatalogNumber),0);
FillChar(InternationalStandardRecordingCode,
SizeOf(InternationalStandardRecordingCode),0);
FillChar(SubHeader,Sizeof(SubHeader),0);
end;
if not Dev^.ModeSelect(Data^,Size) then
begin
writeln('Initialisation of data-writing failed.');
Freemem(Data,MAX_SENSEBUFFER);
Dispose(Dev,Done);
Halt;
end;
Freemem(Data,MAX_SENSEBUFFER);
Getmem(Data,$FFF8);
Dev^.ReadDiscInformation(Data^,$8000);
if PDiscInformation(Data)^.LastTrackInLastSession=1 then
begin
Dev^.ReadTrackInformation(Data^,RTI_TRACK,
PDiscInformation(Data)^.LastTrackInLastSession,$8000);
if ((PTrackInformation(Data)^.TrackType and $40)=0)
or((PTrackInformation(Data)^.NWAValid and 1)=0) then
writeln('Cannot write to CD. Closed ? Broken ?') else
begin
if BigEndianLongint(PTrackInformation(Data)^.FreeBlocks)<
WriteBlocks then
begin
writeln('There is not enough space to store');
writeln('the complete image, abort ...');
Dispose(Dev,Done);
FreeMem(Data,$FFF8);
Close(imagef);
exit;
end;
StartWrite:=BigEndianLongint(
PTrackInformation(Data)^.NextWritableAddr);
writeln('Writing blocks left:');
while (WriteBlocks>0) do
begin
if WriteBlocks>26 then Size:=26 else Size:=WriteBlocks;
BlockRead(imagef,Data^,MAX_CDDATABLOCK*Size);
Dev^.WriteCDInit(StartWrite,Size,MAX_CDDATABLOCK*Size);
if not Dev^.PIODataOut(Data^,MAX_CDDATABLOCK*Size) then
begin
writeln('Error occured while data transfer.');
Break;
end;
while (Dev^.GetStatus and (AST_BSY or AST_DRQ))>0 do;
if (Dev^.GetStatus and AST_CHECK)>0 then
begin
writeln('Error occured while writing.');
Break;
end;
Inc(StartWrite,Size);
Dec(WriteBlocks,Size);
write('Blocks left: ',WriteBlocks,' ',#13);
end;
if not Dev^.SyncCache(true) then
writeln('Warning: Synccache failed.');
write('Closing Track ...');
while not Dev^.TestUnitReady do;
Dev^.CloseTrackSession(CTST_TRACK,1,true);
while (Dev^.GetStatus and AST_BSY)>0 do;
if (Dev^.GetStatus and AST_CHECK)>0 then
writeln(#10,#13,'Warning: The CD could not be closed.')
else
begin
while not Dev^.TestUnitReady do;
writeln(' completed.');
end;
Close(imagef);
end;
end else
writeln('CD is not empty. Writing only to an EMPTY cd-rom.');
Freemem(Data,$FFF8);
write('Finalize CD ? ');
repeat
ch:=Upcase(readkey);
until ch in ['Y','N'];
writeln(ch);
if ch='Y' then
begin
Dev^.CloseTrackSession(CTST_SESSION,0,true);
while (Dev^.GetStatus and AST_BSY)>0 do;
if (Dev^.GetStatus and AST_CHECK)=0 then
begin
write('Closing CD ... This takes about 2 minutes ... ');
while not Dev^.TestUnitReady do;
write(' completed.'+#10+#13+'Ejecting ... ');
Dev^.StartStopUnit(true,false,true);
writeln('done.');
end else
begin
writeln('Fixation failed.');
Dev^.RequestSense;
writeln('Sensekey: ',Dev^.SenseBuffer^.ILISenseKey);
writeln('ASC: ',Dev^.SenseBuffer^.ASC);
writeln('ASCQ: ',Dev^.SenseBuffer^.ASCQ);
end;
end;
Dispose(Dev,Done);
write('Do you want to erase the image-file ? ');
repeat
ch:=Upcase(readkey);
until ch in ['Y','N'];
writeln(ch);
if ch='Y' then Erase(imagef);
end.
Da quello che ho capito va a copiare un immagine

ma se io li volessi far copiare ste fmose e benedette cartelle?
Forza raga pizza e birra per tutti se ce la facciamo...