Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.unix.questions Subject: Re: Cloning File Protection? Keywords: stat(2) chmod(1) Message-ID: <9839@jpl-devvax.JPL.NASA.GOV> Date: 5 Oct 90 23:42:25 GMT References: <277@talarian.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 25 In article <277@talarian.UUCP> scott@talarian.UUCP (Scott Weitzenkamp) writes: : Now I can do what I want: : : chmod `getmod old_foo.c` new_foo.c : : I have a feeling this is probably easy to do in Perl, but I not : really interested in a Perl solution because I cannot guarantee that : our customers will have Perl (I suppose I could put Perl on our : product tape, though). Yes, it's certainly easier in Perl: chmod (stat("old_foo.c"))[2], "new_foo.c"; You have the added advantage of not spawning two processes per file. I would recommend you put Perl on your product tape. Others have done this-- talk to Tom Christiansen of Convex in particular. You can even go as far as to pre-compile it for them, or at least supply a ready-made config.sh. They'll be really impressed! I'm not at all biased, of course... :-) Larry Wall lwall@jpl-devvax.jpl.nasa.gov