in reply to file copy

umask? chmod? File::Copy?

--
I'm not belgian but I play one on TV. On dit que je parle comme un belge aussi.

Replies are listed 'Best First'.
Re^2: file copy
by Madam (Sexton) on Apr 26, 2005 at 12:09 UTC
    I tried using File:NCopy,i.e, File::NCopy->new('set_permission' => "777")->copy($file,"$filename"); but still the permission of the destination file is "-r--r--r--".

      You are asking the same question as you asked in file permissions using File::NCopy and you still haven't properly read and understand the documentation for File::NCopy, the set_permission option to the constructor takes a reference to a subroutine that takes two filenames as it's arguments - the first the one to get the permissions from, and the second one to apply the permissions to. If you really wanted to do that you probably want to do:

      File::NCopy->new('set_permission' => sub { chmod 0644 ,$_[1] })->copy( +$file,"$filename");
      but you probably don't want to use File::NCopy but use plain File::Copy and do chmod 0644, $filename after doing the copy.

      /J\

      If the file is not checked out, clearcase will not allow you to modify it. I'm not sure if File::Copy will return any error messages, but it wouldn't hurt to check. I'm not sure of the syntax (for File::Copy) either, so I can't really tell you if that's right.

      Perl also has chmod built in. Try copying with File::Copy and then
      chmod 0644, $file or warn "Unable to chmod $file!\n$!\n";
      or something similar.
        As you said i did File::NCopy->new('set_permission' => "777")->copy($filepath,"$filename"); and then chmod 0644, $filename; it works now.Thanks .