unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Operating system in an emacs variable?
@ 2003-03-19 10:15 Carsten Dominik
  2003-03-19 11:17 ` Bastien Guerry
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Carsten Dominik @ 2003-03-19 10:15 UTC (permalink / raw)





Hello,

I am looking for a variable or function in Emacs which gives me
information about the operating system the emacs process is running
on.  Basically, I would like to know if I am running Linux or MacOSX.
There must be a variable containing this information, but I could not
find it.  Anyone?

Thanks.

- Carsten

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-19 10:15 Operating system in an emacs variable? Carsten Dominik
@ 2003-03-19 11:17 ` Bastien Guerry
  2003-03-21 15:56   ` Kevin Rodgers
  2003-03-19 11:52 ` Ehud Karni
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Bastien Guerry @ 2003-03-19 11:17 UTC (permalink / raw)


Carsten Dominik <dominik@_DROP_THIS_science.uva.nl> writes:

> I am looking for a variable or function in Emacs which gives me
> information about the operating system the emacs process is running
> on.  Basically, I would like to know if I am running Linux or MacOSX.
> There must be a variable containing this information, but I could not
> find it.  Anyone?

(getenv "MACHINE")

-- 
Bastien

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-19 10:15 Operating system in an emacs variable? Carsten Dominik
  2003-03-19 11:17 ` Bastien Guerry
@ 2003-03-19 11:52 ` Ehud Karni
  2003-03-19 16:03 ` Pete Oster
  2003-03-21 20:38 ` Barman Brakjoller
  3 siblings, 0 replies; 11+ messages in thread
From: Ehud Karni @ 2003-03-19 11:52 UTC (permalink / raw)
  Cc: Bastien Guerry

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 19 Mar 2003 11:15:34 +0100, Carsten Dominik <dominik@_DROP_THIS_science.uva.nl> wrote:
> 
> I am looking for a variable or function in Emacs which gives me
> information about the operating system the emacs process is running
> on.  Basically, I would like to know if I am running Linux or MacOSX.
> There must be a variable containing this information, but I could not
> find it.  Anyone?

Check the `system-type' variable.

Ehud.


- -- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+eFn1LFvTvpjqOY0RAkjmAKCBoJTyyYVP8iywdLwkCcrZmCKfAgCaAwrE
29Cn+LZE37gZYb62/fNVBKw=
=W9k+
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-19 10:15 Operating system in an emacs variable? Carsten Dominik
  2003-03-19 11:17 ` Bastien Guerry
  2003-03-19 11:52 ` Ehud Karni
@ 2003-03-19 16:03 ` Pete Oster
  2003-03-21 20:38 ` Barman Brakjoller
  3 siblings, 0 replies; 11+ messages in thread
From: Pete Oster @ 2003-03-19 16:03 UTC (permalink / raw)


In article <qzuadfrmzll.fsf@sand.science.uva.nl>, Carsten Dominik wrote:
> on.  Basically, I would like to know if I am running Linux or MacOSX.
> There must be a variable containing this information, but I could not
> find it.  Anyone?

There are such variables, but which one you should be using depends on
why you want to know.  For instance, is it really the platform you
want to know, or is it the window system?  Should this test return the
same value for any emacs running in osx (terminal, x11, carbon), or
should it return different values for those three cases?

In short, what is it you're trying to accomplish with this test? 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-19 11:17 ` Bastien Guerry
@ 2003-03-21 15:56   ` Kevin Rodgers
  0 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2003-03-21 15:56 UTC (permalink / raw)


Bastien Guerry wrote:

> (getenv "MACHINE")


nil

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-19 10:15 Operating system in an emacs variable? Carsten Dominik
                   ` (2 preceding siblings ...)
  2003-03-19 16:03 ` Pete Oster
@ 2003-03-21 20:38 ` Barman Brakjoller
  2003-03-21 23:15   ` Kevin Rodgers
  3 siblings, 1 reply; 11+ messages in thread
From: Barman Brakjoller @ 2003-03-21 20:38 UTC (permalink / raw)


> I am looking for a variable or function in Emacs which gives me
> information about the operating system the emacs process is running

Oh? What a disapointment! The subject of this thread sounded really
really cool; imagine putting a whole operating system into an emacs
variable! That would have been really cool!

:)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-21 20:38 ` Barman Brakjoller
@ 2003-03-21 23:15   ` Kevin Rodgers
  2003-03-22 21:45     ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Rodgers @ 2003-03-21 23:15 UTC (permalink / raw)


Barman Brakjoller wrote:

> Oh? What a disapointment! The subject of this thread sounded really
> really cool; imagine putting a whole operating system into an emacs
> variable! That would have been really cool!

(defvar system
  (with-temp-buffer
    (insert-file-contents-literally
     (cond ((file-executable-p "/etc/init") "/etc/init")
	   ((file-executable-p "C:\\sys\\windows.exe")	; or whatever
	    "C:\\sys\\windows.exe")))
    (buffer-string))
  "The current operating system.")


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-21 23:15   ` Kevin Rodgers
@ 2003-03-22 21:45     ` Stefan Monnier
  2003-03-27 15:49       ` Kevin Rodgers
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2003-03-22 21:45 UTC (permalink / raw)


>>>>> "Kevin" == Kevin Rodgers <kevin.rodgers@ihs.com> writes:
>      (cond ((file-executable-p "/etc/init") "/etc/init")

Your notion of "operating system" is very restricted, to say the least.
Try something like "/vmlinuz" or some such instead (there's no standard
name for it).


        Stefan "who also first understood the subject line this way"

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-22 21:45     ` Stefan Monnier
@ 2003-03-27 15:49       ` Kevin Rodgers
  2003-03-27 21:23         ` Kai Großjohann
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Rodgers @ 2003-03-27 15:49 UTC (permalink / raw)


Stefan Monnier wrote:

>>>>>>"Kevin" == Kevin Rodgers <kevin.rodgers@ihs.com> writes:
>>>>>>
>>     (cond ((file-executable-p "/etc/init") "/etc/init")
>>
> 
> Your notion of "operating system" is very restricted, to say the least.
> Try something like "/vmlinuz" or some such instead (there's no standard
> name for it).
 

I think on SunOS it was called /vmunix, but on my system (Solaris 7)
there's no such file.  On Solaris, process 0 is sched, for which I can't
find a binary, and process 1 is /etc/init.

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-27 15:49       ` Kevin Rodgers
@ 2003-03-27 21:23         ` Kai Großjohann
  2003-03-27 22:18           ` Kevin Rodgers
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Großjohann @ 2003-03-27 21:23 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

>  I think on SunOS it was called /vmunix, but on my system (Solaris 7)
> there's no such file.

Is it /stand/kernel there?  SysV uses a different naming convention
for these things...
-- 
A preposition is not a good thing to end a sentence with.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Operating system in an emacs variable?
  2003-03-27 21:23         ` Kai Großjohann
@ 2003-03-27 22:18           ` Kevin Rodgers
  0 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2003-03-27 22:18 UTC (permalink / raw)


Kai Großjohann wrote:


> Is it /stand/kernel there?  SysV uses a different naming convention
> for these things...

Nope:

/stand: No such file or directory


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-27 22:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-19 10:15 Operating system in an emacs variable? Carsten Dominik
2003-03-19 11:17 ` Bastien Guerry
2003-03-21 15:56   ` Kevin Rodgers
2003-03-19 11:52 ` Ehud Karni
2003-03-19 16:03 ` Pete Oster
2003-03-21 20:38 ` Barman Brakjoller
2003-03-21 23:15   ` Kevin Rodgers
2003-03-22 21:45     ` Stefan Monnier
2003-03-27 15:49       ` Kevin Rodgers
2003-03-27 21:23         ` Kai Großjohann
2003-03-27 22:18           ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).