| [reply] |
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--".
| [reply] |
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\ | [reply] [d/l] [select] |
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. | [reply] [d/l] |
That would be because of your umask, which unsets bits on
file mode operations.
| [reply] |
You need to check the file out either unreserved or reserved. i.e. cleartool co [-unr] file
Then you can do with it what you will.
Not really sure how this is related to Perl, but uhmm...
perl -le '`cleartool co -unr file`'
for grins :) (code untested)
Oh and then simply chmod 644 (or, in Perl: chmod 0644) the file | [reply] [d/l] [select] |