473,725 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_di r/$file");
print "return is $ret. $!\n";
....

This returns:

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

The file "testfile.t xt" 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 4319
In article <bo**********@n ewstree.wise.ed t.ericsson.se>, Tony George
<to*********@er icsson.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
1473
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
17036
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 with '\\' it doesnt work and exception is thrown (for example: \\MyComputer\DestDirectory). Even if the first and the second directories are actually the same- the File.Copy() doesn't work. Is there any way to copy a file to a different computer?...
4
3500
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 from one computer to another over a 1GBit ethernet network as fast as I can. Although windows copy works at %40 performance, File.Copy could not go further than %4. What could be the reason? What would be the best solution; is it feasible to
2
5504
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 filename. The file actually appears to copy just fine. The problem is it throws an IOException with the message:
2
3771
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 it on the web server but not from a client. Here is the code: Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity currentWindowsIdentity...
4
2161
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 login to my ftp site, any subsequent File.Copy commands will not require server authentication. this fails - invalid string format: string source = "c:\\src#\\appl\\bin\\Debug\\orders.dll" ; string dest =...
2
1460
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") File.Copy("C:\ABC\2.txt", "C:\XYZ\2.txt") Does exist way in .Net for copying file by template?
6
9627
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" crashed and had to be rebuilt. Now, when the File.Copy method in the VB.Net program is executed an error occurs about 90% of the time, always with a larger file. Here's the line of code: File.Copy(sFileName, sDistributionPathFile)
3
5147
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 a shared folder. eg., File.Copy(srcPath, "\\machinename\\folder) This is giving an error "Could not find part of the path \\machinename\\folder" Is this feature supported? if yes please can anyone let me knwo how to
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.