View Full Version : environment vars
pawl
2nd April 2005, 20:25
Is it possible to access user environment variables from an avisynth script? I know I could do some sort of replace with a batch file, but I'd prefer not to..
Thanks!
esby
2nd April 2005, 23:44
You mean accessing the window environment variables?
Or accessing what is stored in the avs environnment (aka env)
esby
pawl
3rd April 2005, 03:36
Yeah, the windows environment variables. :)
stickboy
3rd April 2005, 06:36
I don't think there currently is a way.
I think it should be pretty trivial to write a plug-in that can retrieve values of environment variables, though. I can give it a shot tomorrow unless someone else feels like doing it (and probably doing it better). :)
stickboy
3rd April 2005, 11:15
Okay, try this: GetSystemEnv (http://www.avisynth.org/stickboy/GetSystemEnv.zip)
Edit:
Renamed from GetEnv by request. :)
esby
3rd April 2005, 11:24
Wouldn't it better to rename it to GetWinEnv instead of GetEnv
as there is already an internal env context in avisynth?
This could avoid confusion.
esby
stickboy
3rd April 2005, 11:51
Maybe... but the other environment isn't (and probably should never need to be) accessible via user scripts.
And I know that AviSynth is pretty Windows-specific, but I'd prefer to avoid using a Windows-specific name (especially since it's just a pass-through to getenv() from the C standard library).
Maybe GetOSEnv or GetSystemEnv or something?
esby
3rd April 2005, 12:02
Oh right,
getSystemEnv() might work
esby
pawl
3rd April 2005, 21:31
Awesome! Much thanks! :D
pawl
5th April 2005, 02:09
Any good reason these functions aren't in the core?
stickboy
5th April 2005, 07:13
No one requested them before. :)
I don't have CVS access, but if someone who does thinks they're appropriate, they're more than welcome to merge those functions in (the code's pretty trivial anyway).
DigitAl56K
26th May 2009, 20:46
Bump up and vote +1 for adding to the core :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.