• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Setting environment variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting environment variables


  • Subject: Re: Setting environment variables
  • From: Timo Hoepfner <email@hidden>
  • Date: Fri, 14 Aug 2009 16:43:44 +0200


Am 14.08.2009 um 15:26 schrieb Timo Hoepfner:

I'm almost about to write a JNA wrapper for setting the environment programatically...

Done...

import com.sun.jna.Library;
import com.sun.jna.Native;

public class PDEnvironmentUtilities {
private static final CLibrary LIBC = (CLibrary) Native.loadLibrary("c", CLibrary.class);


	public static String getenv(String name) {
		return LIBC.getenv(name);
	}

	public static void setenv(String name, String value) {
		if(value == null)
			LIBC.unsetenv(name);
		else
			LIBC.setenv(name, value, 1);
	}

	// http://www.gnu.org/software/libc/manual/html_node/Environment-Access.html#Environment-Access
	private interface CLibrary extends Library {
		public int setenv(String name, String value, int replace);
		public String getenv(String name);
		public int unsetenv(String name);
	}
}

Timo

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Setting environment variables (From: Timo Hoepfner <email@hidden>)

  • Prev by Date: Re: Setting environment variables
  • Next by Date: Re: WebObjects 4.5
  • Previous by thread: Re: Setting environment variables
  • Next by thread: JDBC close() exception?
  • Index(es):
    • Date
    • Thread