473,480 Members | 5,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question about putenv()

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
3 2461
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9582
by: Noah | last post by:
The problem I'm having is that whenever a user enters accented characters character into a form field the characters are getting stored as question marks in the database. For example, "façade" (c...
16
2061
by: WindAndWaves | last post by:
Hi there I have $initstartdate = date("d-m-Y"); in my code How can I get it to be date() + 1 or 7 for that matter. Because my server is in the US and I am in New Zealand, they are always...
3
3049
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
7
2615
by: dpugmire | last post by:
Is there a trick to getting putenv/getenv to work? I have csh script that calls a bunch of python programs and I'd like to use env variables as kind of a global variable that I can pass around to...
4
2306
by: Yogi Watcher | last post by:
Hi, Recently I have observed some odd behavior of getenv and putenv function. I am developing some code that integrates with several other libraries. This program is not using MFC. It is plain C...
12
2825
by: Marcus | last post by:
Hello, I need a timezone to store timestamps in that is independent of daylight saving. From everything I've read, it seems I want either GMT or UTC. The only problem is I can't figure out from...
8
3205
by: Michael B Allen | last post by:
Is the string returned by getenv guaranteed to be the same string supplied to putenv plus the offset of the variable name and equals sign? Because of API constraints I do not want to save a...
4
2932
by: ClownPleco | last post by:
I have read several posts about putenv is not Standard C. But I'm wondering if anyone knows if it is available in AIX. All of our other platforms (linux (32 and 64 bit), sgi, hpux, x86, darwin...
4
16398
by: google | last post by:
>>> 'C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;%C:\\WINNT%\ \system32;%C:\\WINNT%;%C:\\WINNT%\\System32\\Wbem' 'C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;%C:\\WINNT%\...
0
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.