Win32OperatingSystem.st
changeset 5264 9a90c499e329
parent 5147 305aa6d3926a
child 5908 88ca91a97eeb
equal deleted inserted replaced
5263:48bd443fecd9 5264:9a90c499e329
  6228 !
  6228 !
  6229 
  6229 
  6230 getHomeDirectory
  6230 getHomeDirectory
  6231     "{ Pragma: +optSpace }"
  6231     "{ Pragma: +optSpace }"
  6232 
  6232 
  6233     "return the name of the users home directory
  6233     "return the name of the users home directory (i.e. yours).
  6234      (i.e. yours)"
  6234      This uses the value of the HOME environment variable,
       
  6235      or HOMEDRIVE:HOMEPATH as a fallBack.
       
  6236      If not set, return the current directory."
  6235 
  6237 
  6236     |dir drv path|
  6238     |dir drv path|
  6237 
  6239 
  6238     dir := self getEnvironment:'HOME'.
  6240     dir := self getEnvironment:'HOME'.
  6239     dir isNil ifTrue:[
  6241     dir isNil ifTrue:[
  6240 	"/ for NT users:
  6242         "/ for NT users:
  6241 	"/ if HOME is nil, try HOMEDRIVE and HOMEPATH
  6243         "/ if HOME is nil, try HOMEDRIVE and HOMEPATH
  6242 	"/
  6244         "/
  6243 	((drv := self getEnvironment:'HOMEDRIVE') notNil
  6245         ((drv := self getEnvironment:'HOMEDRIVE') notNil
  6244 	and:[(path := self getEnvironment:'HOMEPATH') notNil]) ifTrue:[
  6246         and:[(path := self getEnvironment:'HOMEPATH') notNil]) ifTrue:[
  6245 	    dir := drv , path
  6247             dir := drv , path
  6246 	]
  6248         ] ifFalse:[
       
  6249             dir := '.'.
       
  6250         ].
  6247     ].
  6251     ].
  6248     ^ dir
  6252     ^ dir
  6249 
  6253 
  6250     "
  6254     "
  6251      OperatingSystem getHomeDirectory
  6255      OperatingSystem getHomeDirectory
  6252     "
  6256     "
  6253 
  6257 
  6254     "Modified: 24.1.1997 / 11:32:13 / cg"
  6258     "Modified: / 16.2.2000 / 09:17:55 / cg"
  6255 !
  6259 !
  6256 
  6260 
  6257 getLoginName
  6261 getLoginName
  6258     "{ Pragma: +optSpace }"
  6262     "{ Pragma: +optSpace }"
  6259 
  6263 
  8143 ! !
  8147 ! !
  8144 
  8148 
  8145 !Win32OperatingSystem class methodsFor:'documentation'!
  8149 !Win32OperatingSystem class methodsFor:'documentation'!
  8146 
  8150 
  8147 version
  8151 version
  8148     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.90 1999-12-23 23:30:46 cg Exp $'
  8152     ^ '$Header: /cvs/stx/stx/libbasic/Win32OperatingSystem.st,v 1.91 2000-02-16 08:10:17 cg Exp $'
  8149 ! !
  8153 ! !
  8150 Win32OperatingSystem initialize!
  8154 Win32OperatingSystem initialize!