Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a file is checked out (Clearcase / Python)

I guess the title sufficiently sums up my question. I have working code to automatically check out a file:

 p = Popen(['cleartool', 'co', pathname], stdin = PIPE)
 p.communicate('comment for checkout')

I'm wondering how to check if the file is already checked out before executing this. Thanks in advance everyone!

like image 584
Jon Avatar asked Oct 18 '25 19:10

Jon


1 Answers

You can parse the output of a cleartool ls -short pathname

If checked out, its version will end with /CHECKEDOUT.

Or you can go ahead, try to check out and test the exit status of the command. But there could be other causes for failure (other than "already checked out")

like image 83
VonC Avatar answered Oct 20 '25 08:10

VonC