|
From: <bc...@wo...> - 2001-11-01 17:04:56
|
On Thu, 1 Nov 2001 10:26:25 -0500, you wrote: >On Thu, Nov 01, 2001 at 03:14:17PM +0000, Finn Bock wrote: >| [Phil Surette] > >| >I haven't thought writing through yet, but I figure >| >reading will hit a large percentage of the use cases. >| >| Writing is normally done by inserting values in the os.environment dict >| and using that dict for the os.system() call. We can't possibly do any >| better in core jython. > >How does os.setenv() figure into this? I guess you mean os.putenv()? >I imagine that this operation is probably not possible in Java, Right. >thus the call should either silently >ignore it, or raise an exception. Either os.putenv() shouldn't be implemented at all or it should be implemented as: def putenv(varname, value): os.enviroment[varname] = value >I was thinking that, perhaps, some environment values can be gotten >from Java directly. For example, > > print os.eviron[ "HOME" ] > > could be the same as > > System.out.println( System.getProperty( "user.home" ) ) ; > >though on some JVMs, user.home is really messed up (ex, jdk1.1.8 on >win). I think Java ignores the user's preferences (ie setting $HOME >in bash or cmd.exe) and using whatever it feels like, so this may not >be a good idea. The property route should not be mixed with the "sh -c env" route. Using properties have been mentioned before, but nobody have picked it up and suggested a patch. I guess it is because the defined set of properties is too limited to be really usefull as a replacement for environment variables. regards, finn |