Skip to main content
4-Participant
January 17, 2014
Question

mks si co without confirmation

  • January 17, 2014
  • 1 reply
  • 1380 views

Hello

I need an mks cmd command to do the followings:

{

Step 1: check out a member and put an exclusive lock on it

Step 2: if other person has locked the file from step 1 the command should tell me that he cannot made an exclusive lock because the User x has the excluseive lock

}

I tried the following command but it works only for step 1

{

si co --user=yyyyy --password=xxxxxx--hostname=mks2.dc.hella.com --port=7001 --cpid=:none -S _SANDBOX_PATH_\project.pj c:\_FILEPATH__\ONLY_FOR_TEST__3.xls --nodowngradeOnLockConflict -no

}

I need to improove the above command in order to skip the following question :

{

Do you want an exlusive lock?

}

that I am encountering in this moment.

Best Regards,

    1 reply

    1-Visitor
    January 17, 2014

    Hello

    you could check in your script if the file is locked by someone else before locking

    using for example the command

    si memberinfo --lockRecordFormat={locker} $file

    Parse its output to extract the locker and compare with getenv('username').

    HTH

    Thierry