By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,285 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,285 IT Pros & Developers. It's quick & easy.

Using File::Copy with ClearCase Views

P: n/a
Hi,

I'm having a problem using the Copy module on a ClearCase view that's been
set as "readonly" (i.e. ct chview -readonly <view tag>). I want to copy a
file out of this view and put it in another directory that's outside of
ClearCase. The strange thing is that the copy command actually copies
correctly. The problem is that it returns a "0" errorcode because of the
fact that the view is readonly. I guess "copy" still tries to write
something to the view even though it's only doing a copy.

e.g.

....
my $ret = copy("$basepath/StdOutput/$file", "$stdout_dir/$file");
print "return is $ret. $!\n";
....

This returns:

... copying testfile.txt
return is 0. Read-only file system

The file "testfile.txt" is successfully copied to the correct location, but
I have some other things to do in the script based on the return code. The
"0" return code is messing that all up because the operation is in fact
successful.

The only solution I can think of is to just use a "system" command with Unix
"cp" (I'm on Solaris 8). I couldn't really figure out any other options
from just looking at the man pages.

Does anyone have other possible solutions or suggestions if I'm doing
something wrong?

Thanks...

Tony
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <bo**********@newstree.wise.edt.ericsson.se>, Tony George
<to*********@ericsson.com> wrote:
Hi,

I'm having a problem using the Copy module on a ClearCase view that's been
set as "readonly" (i.e. ct chview -readonly <view tag>).
[SNIP]

The only solution I can think of is to just use a "system" command with Unix
"cp" (I'm on Solaris 8). I couldn't really figure out any other options
from just looking at the man pages.

Does anyone have other possible solutions or suggestions if I'm doing
something wrong?


You are using the module File::Copy, right? I haven't used this, so
don't have any idea what your problem. I suggest if it is not working,
you just us system('cp ...') if that works. It will be a little slower,
because it does the copy in a subprocess. You could also ignore the
return code and check if the copy succeeded with a file operator, e.g.
-e to see if the copy exists, -s to get the size and compare with the
original. The code for File::Copy is on your system and is pure perl,
so maybe you can figure out what is wrong. But don't beat yourself up
if it is not working, just try something else. You could also try
contacting the authors of File::Copy.

Since comp.lang.perl is a defunct newsgroup, you might get better
response for general perl questions using comp.lang.perl.misc or, since
you are having a problem with a module, comp.lang.perl.modules
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.