Using cp: preserving file/folder attributes and auto creating folders

Hi,

Is there a way to use cp in such a way that when a file is copied to a destination, the required destination folders are automatically created with the proper permissions, and the resulting copied file has the same attributes as the original. For example if I copied /System/Library/Extensions.mkext to /somefolder/System/Library/Extensions.mkext the System and Library folders in somefolder would automatically be created with correct permissions and the file would be copied with the same attributes as the original.

Thanks

cpio with the "-p" switch is described in "man cpio" and "man find".
This is the best way to copy whole trees intact.

For example (as O/S was not stated, this is does not take account of links):

cd source_dir
find . -print|cpio -pdumv /destination_dir