470,821 Members | 1,995 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

Using File::Copy with ClearCase Views

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
1 4188
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.

Similar topics

4 posts views Thread by Pino | last post: by
4 posts views Thread by adnan boz | last post: by
2 posts views Thread by Pete Davis | last post: by
2 posts views Thread by Stephen Witter | last post: by
4 posts views Thread by Steve Richter | last post: by
2 posts views Thread by Jul | last post: by
6 posts views Thread by RitaG | last post: by
3 posts views Thread by =?Utf-8?B?R2FuZXNoYQ==?= | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.