Question about putenv()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Warren Oates

    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.
  • Michael Fuhr

    #2
    Re: Question about putenv()

    Warren Oates <Warren@InHell. Com> writes:
    [color=blue]
    > 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.[/color]

    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

    Comment

    • Warren Oates

      #3
      Re: Question about putenv()

      In article <3fc80d5f$1_1@o mega.dimensiona l.com>,
      mfuhr@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.

      Comment

      • Michael Fuhr

        #4
        Re: Question about putenv()

        Warren Oates <Warren@InHell. Com> writes:
        [color=blue]
        > In article <3fc80d5f$1_1@o mega.dimensiona l.com>,
        > mfuhr@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.[/color]

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

        --
        Michael Fuhr

        Comment

        Working...