G
g4173c
Hi:
I have the following code for checking if a file is all ready
checked out for editing. It works if the file is checked out, however
if the file isn't checked out the pipe is closed and I never go into
the while loop. Any ideas what I should change to get this to work?
sub CC_ChkOut {
my $ccfile = shift (@_);
#
# Check to see if the file is all ready checked out, if not check it
out unreserved.
#
open (CC, "cleartool lsco -me $ccfile |") or die "Error: Problem
with check file status: $!\n";
while (<CC>) {
if (/checkout/) {
print "All ready checked out...\n";
}
else {
system ("cleartool co -unr -nc $ccfile") == 0 || die
"Error: Couldn't Check Out $ccfile: $!\n";
}
}
}
Thanks in advance for any help!!
Tom
I have the following code for checking if a file is all ready
checked out for editing. It works if the file is checked out, however
if the file isn't checked out the pipe is closed and I never go into
the while loop. Any ideas what I should change to get this to work?
sub CC_ChkOut {
my $ccfile = shift (@_);
#
# Check to see if the file is all ready checked out, if not check it
out unreserved.
#
open (CC, "cleartool lsco -me $ccfile |") or die "Error: Problem
with check file status: $!\n";
while (<CC>) {
if (/checkout/) {
print "All ready checked out...\n";
}
else {
system ("cleartool co -unr -nc $ccfile") == 0 || die
"Error: Couldn't Check Out $ccfile: $!\n";
}
}
}
Thanks in advance for any help!!
Tom