473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 4302
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pino | last post by:
What is the fastest way to copy a file from a device to a different destination? I know there is a difference between File.Copy and the FileCopy API. Thanks, Pino.
8
by: Ram Baruch | last post by:
Hi, I'm trying to use the File.Copy() function. It works well when the desenation file is local (Like: C:\dest\dest.exe). The problem is that when I'm trying to copy to a destenation that starts...
4
by: adnan boz | last post by:
Hi All, Does somebody know why File.Copy function is 10 times slower than standard windows drag and drop copy between folders, when I copy files over the network? Actually, I need to copy files...
2
by: Pete Davis | last post by:
I'm getting an exception when trying to copy a file. I basically do a File.Copy(source, dest, false); source is the source full path and filename. dest is the destination full path and...
2
by: Stephen Witter | last post by:
I had previously posted this on the security ng, but haven't had a hit so I was wondering if someone here would be willing to take a stab. I am trying to copy a file to a network drive. I can do...
4
by: Steve Richter | last post by:
can File.Copy be use to copy files from my PC to the file system at my shared hosting web site? If so, what is the format of the path name of the file on the web site? The idea being that if I...
2
by: Jul | last post by:
File.Copy Method does not let use template for copying files, I can not use File.Copy("C:\ABC\*.txt", "C:\XYZ\*.txt") but I need to use such way: File.Copy("C:\ABC\1.txt", "C:\XYZ\1.txt")...
6
by: RitaG | last post by:
Hello. I have a VB.Net program that copies a file from one server to another server. This program has been working without any problems for about a year. A couple of weeks ago the "server from"...
3
by: =?Utf-8?B?R2FuZXNoYQ==?= | last post by:
Hi I would like to use File.Copy with UNC paths. I have seen this problem reported by others as well. Can i use File.Copy with UNC paths. ie., i would like to copy a file from one of the folder to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.