I have script to copy single files but I need a script to copy whole directories. Does any one know how this can be achieved?
Here's the code I have at the moment:
assign(source,main); {the file to be copied is assigned a path passed by reference}
assign(dest,backup); {where the file is copied to is defined in the procedure}
reset(source,1); {opens the file at the begining and sets the number of records to 1}
rewrite(dest,1); {creates a new file with one record}
getmem(buffer,1024); {gives the pointer (buffer^) 1024 bytes of memory}
REPEAT {until size of data being read is < 1Kb}
blockread(source,buffer^,1024,actually_read);
blockwrite(dest,buffer^,actually_read,written);
UNTIL actually_read < 1024;
close(source);
close(dest);
writexy(3,48,'File copied :: <return>');
readln;
~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
Here's the code I have at the moment:
assign(source,main); {the file to be copied is assigned a path passed by reference}
assign(dest,backup); {where the file is copied to is defined in the procedure}
reset(source,1); {opens the file at the begining and sets the number of records to 1}
rewrite(dest,1); {creates a new file with one record}
getmem(buffer,1024); {gives the pointer (buffer^) 1024 bytes of memory}
REPEAT {until size of data being read is < 1Kb}
blockread(source,buffer^,1024,actually_read);
blockwrite(dest,buffer^,actually_read,written);
UNTIL actually_read < 1024;
close(source);
close(dest);
writexy(3,48,'File copied :: <return>');
readln;
~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."