The connect command. Maintaining a persistent stateful session


The syntax for this command is
stcmd connect [username[:password]@]address:port [passwordFromFile passwordFile] [storePasswordToFile passwordFile] [caseSensitiveFolders | -csf] [encryption = RC4|RC2_ECB|RC2_CBC_RC2_FCB] [compression | -cmp] [mpx=on|off (default ON) [profile=eventHandlerProfilename] [cacheAgent@address:port (default autoLocate] | =off] [[cacheAgentThreads=noOfThreads][-mode [lock | exlock | unlock]] [separator=fieldSeparator] [headers = on|off]

Use connect to connect to the StarTeam Server. The connection persists until you use the disconnect command. Because the connection persists, you can specify all subsequent commands without using the -p option to connect with each command.

However, to switch between projects, views, and working folders,
use set project...[viewHierarchy ] [folderHierarchy ] while in the same session.
Note: This command is part of the stateful model and only works with stcmd, not stcmdEx.

Parameter Description
-cmp Compresses all the data sent between the workstation and the server and decompresses it
when it arrives. Without this option, compression does not take happen.
Compression is most useful and appropriate when the client and server communicate over a
slow connection. To determine whether to use compression, a small test case may be helpful.
You must consider whether the time spent compressing and uncompressing data is better
than the longer transfer time of uncompressed data sent over the slow connection.

-mode Indicates whether the server is to be locked, exclusively locked, or unlocked.
-mode lock Only server administration commands are accepted until the server is
unlocked. For example, you might use this command while running a
backup program.
-mode exlock Only you can access the server until it is unlocked. For example, you might
do this when creating a custom field.
-mode unlock Use to make the server available to users again.
lock Nonexclusively locks the StarTeam Server. Only administrative commands can be performed.
unlock Unlocks the StarTeam Server so that anyone with the appropriate access rights can access
exlock Exclusively locks the server so that no one else can access it.

headers By default, headers = on. If headers = off, output files are written without headers.

The following example uses connect to connect to the server using port 1024 on Orion and nonexclusively
locks the server.
connect "JMarsh:password@Orion:1024" -mode lock


How To-Best Practice
Comment List
  • I am involved with a routine where I would need a persistent connection, so I need connect and disconnect. However, I do not want to  pass a clear password to my routine.  In my previous scripts, I've always used epwdfile which works fine. I noticed this method uses passwordfrom file. I tried it but I was asked a password at the command line. 

    I then used the storepasswordto file to store a new password file. I saw that it is encrypted but different than my epwdfil.

    However, even is I use passwordfromfile with my new password file, I still get promoted for my password.

    Is the command line  really the following?

    stcmd connect user@server:port PasswordfromFile C:\myFile.txt

Related Discussions