in reply to Perl cp -p?

DrWhy,
Have you taken a look at File::NCopy? The set_permission and preserve thingies look interesting though I have to admit I didn't try it out.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: Perl cp -p?
by DrWhy (Chaplain) on Aug 20, 2004 at 22:43 UTC
    I tried it and it seems to work on my Solaris box/Perl 5.6.1: Here's some test code if anyone is interested:

    use File::NCopy; $c = new File::NCopy(preserve => 1); $c->copy("test", "test2");

    This code successfully preserved permissions, group, and modified/access times. Presumably owner would also be preserved, but I'm not running as root so didn't bother to test that. Without preserve => 1, permissions are still preserved but the other stuff isn't.

    Thanks, L~R.

    -- DrWhy