By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Question about putenv()

P: n/a
I've been using putenv() to change the timezone in a script (my server
is in CST, me in EST). My reading of the docs suggests that this changes
the time zone environment variable for _the server_ for the duration of
the script. Is this polite? If another account accesses the server at
exactly the same time my script is running, is that "customer" stuck in
EST? Because there are a number of ways of dealing with timezone
differences, this is just the simplest.

Thanks.
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Warren Oates <Wa****@InHell.Com> writes:
I've been using putenv() to change the timezone in a script (my server
is in CST, me in EST). My reading of the docs suggests that this changes
the time zone environment variable for _the server_ for the duration of
the script. Is this polite? If another account accesses the server at
exactly the same time my script is running, is that "customer" stuck in
EST? Because there are a number of ways of dealing with timezone
differences, this is just the simplest.


One of the best ways to learn is to perform experiments. Set the
environment variable in one script, do something like sleep() to
make sure that the script takes a long time to run, and then issue
requests for other scripts and check whether they're influenced by
the environment variable you set in the first script.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #2

P: n/a
In article <3f**********@omega.dimensional.com>,
mf***@fuhr.org (Michael Fuhr) wrote:

:One of the best ways to learn is to perform experiments. Set the
:environment variable in one script, do something like sleep() to
:make sure that the script takes a long time to run, and then issue
:requests for other scripts and check whether they're influenced by
:the environment variable you set in the first script.

That's a good idea, and I've done much the same thing. What I'm really
concerned about is someone else with an account on the same server
having their environment "highjacked" by my scripts.
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #3

P: n/a
Warren Oates <Wa****@InHell.Com> writes:
In article <3f**********@omega.dimensional.com>,
mf***@fuhr.org (Michael Fuhr) wrote:

:One of the best ways to learn is to perform experiments. Set the
:environment variable in one script, do something like sleep() to
:make sure that the script takes a long time to run, and then issue
:requests for other scripts and check whether they're influenced by
:the environment variable you set in the first script.

That's a good idea, and I've done much the same thing. What I'm really
concerned about is someone else with an account on the same server
having their environment "highjacked" by my scripts.


What happened in your experiments? Did your own scripts have their
environment "hijacked" by the script that set the environment
variable?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.