Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd April 2005, 20:25   #1  |  Link
pawl
Registered User
 
Join Date: Dec 2002
Posts: 15
environment vars

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!
pawl is offline   Reply With Quote
Old 2nd April 2005, 23:44   #2  |  Link
esby
Registered User
 
esby's Avatar
 
Join Date: Oct 2001
Location: france
Posts: 521
You mean accessing the window environment variables?
Or accessing what is stored in the avs environnment (aka env)

esby
__________________
http://esby.free.fr/
esby is offline   Reply With Quote
Old 3rd April 2005, 03:36   #3  |  Link
pawl
Registered User
 
Join Date: Dec 2002
Posts: 15
Yeah, the windows environment variables.
pawl is offline   Reply With Quote
Old 3rd April 2005, 06:36   #4  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
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 is offline   Reply With Quote
Old 3rd April 2005, 11:15   #5  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Okay, try this: GetSystemEnv

Edit:
Renamed from GetEnv by request.

Last edited by stickboy; 3rd April 2005 at 12:05.
stickboy is offline   Reply With Quote
Old 3rd April 2005, 11:24   #6  |  Link
esby
Registered User
 
esby's Avatar
 
Join Date: Oct 2001
Location: france
Posts: 521
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
__________________
http://esby.free.fr/
esby is offline   Reply With Quote
Old 3rd April 2005, 11:51   #7  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
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?

Last edited by stickboy; 3rd April 2005 at 11:59.
stickboy is offline   Reply With Quote
Old 3rd April 2005, 12:02   #8  |  Link
esby
Registered User
 
esby's Avatar
 
Join Date: Oct 2001
Location: france
Posts: 521
Oh right,
getSystemEnv() might work

esby
__________________
http://esby.free.fr/
esby is offline   Reply With Quote
Old 3rd April 2005, 21:31   #9  |  Link
pawl
Registered User
 
Join Date: Dec 2002
Posts: 15
Awesome! Much thanks!
pawl is offline   Reply With Quote
Old 5th April 2005, 02:09   #10  |  Link
pawl
Registered User
 
Join Date: Dec 2002
Posts: 15
Any good reason these functions aren't in the core?
pawl is offline   Reply With Quote
Old 5th April 2005, 07:13   #11  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
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).
stickboy is offline   Reply With Quote
Old 26th May 2009, 20:46   #12  |  Link
DigitAl56K
Registered User
 
Join Date: Nov 2002
Location: San Diego, CA
Posts: 936
Bump up and vote +1 for adding to the core
DigitAl56K is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.