cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

PTC_D_LICENSE_FILE Definition

DaveLeFevre
4-Participant

PTC_D_LICENSE_FILE Definition

Can someone explain what the "-" does in the environment variable definition in .psf file (i.e. PTC_D_LICENSE_FILE-=<port>@<License Server Name>)

1 ACCEPTED SOLUTION

Accepted Solutions

Out of curiosity I've tested it (as I have never before paid that much attention to it) and it doesn't seem like a superfluous character like @KenFarley suspected. From what I saw it looks like this:

 

1. ENV=VARIABLE_NAME=VALUE

will set the variable VARIABLE_NAME with only a VALUE defined in psf file, e.g. ENV=PTC_D_LICENSE_FILE=7788@license_server will get you variable PTC_D_LICENSE_FILE=7788@license_server regardless of its previous value.

 

2. ENV=VARIABLE_NAME+=VALUE

will append the value at the end of the VARIABLE_NAME existing values list. e.g. ENV=PTC_D_LICENSE_FILE+=7788@localhost, will get you PTC_D_LICENSE_FILE=7788@license_server;7788@localhost (appending to the previously defined variable value of 7788@license_server)

 

3. ENV=VARIABLE_NAME-=VALUE

will place the new value in the beginning of values list for that variable, e.g. ENV=PTC_D_LICENSE_FILE-=7788@localhost will get you PTC_D_LICENSE_FILE=7788@localhost;7788@license_server (so when Creo starts your local license server will take precedence when searching for Creo licenses and when it's not available Creo will fall back to the next server in line).

 

Hope it makes sense. You can see that PATH variables are defined in similar way, using "+" and "-" to not overwrite existing PATH values but to append the new values at correct places.

View solution in original post

5 REPLIES 5

It's just a character. Probably in the past someone *meant* to just have the variable be PTC_D_LICENSE_FILE, but made a typo and added a superfluous "-" and now the world at large is stuck with it? It's not particularly readable, but perfectly legal in the context of an environment variable name.

DaveLeFevre
4-Participant
(To:KenFarley)

Thank you Ken for the feedback.

I thought there was a function of this character in the past, but I'm glad to hear there is no relevance to this character.

Out of curiosity I've tested it (as I have never before paid that much attention to it) and it doesn't seem like a superfluous character like @KenFarley suspected. From what I saw it looks like this:

 

1. ENV=VARIABLE_NAME=VALUE

will set the variable VARIABLE_NAME with only a VALUE defined in psf file, e.g. ENV=PTC_D_LICENSE_FILE=7788@license_server will get you variable PTC_D_LICENSE_FILE=7788@license_server regardless of its previous value.

 

2. ENV=VARIABLE_NAME+=VALUE

will append the value at the end of the VARIABLE_NAME existing values list. e.g. ENV=PTC_D_LICENSE_FILE+=7788@localhost, will get you PTC_D_LICENSE_FILE=7788@license_server;7788@localhost (appending to the previously defined variable value of 7788@license_server)

 

3. ENV=VARIABLE_NAME-=VALUE

will place the new value in the beginning of values list for that variable, e.g. ENV=PTC_D_LICENSE_FILE-=7788@localhost will get you PTC_D_LICENSE_FILE=7788@localhost;7788@license_server (so when Creo starts your local license server will take precedence when searching for Creo licenses and when it's not available Creo will fall back to the next server in line).

 

Hope it makes sense. You can see that PATH variables are defined in similar way, using "+" and "-" to not overwrite existing PATH values but to append the new values at correct places.

@LukaszMazur Thank you for investing this. I thought I remembered something about the '-' but I was not aware of the '+'

Thank you for looking into this and sharing your findings.

Wow, that is really weird and pretty cool. It's like C code in the initialization file. Live and learn.

Top Tags