Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Check Windows or Linux?

Guest
Jun 13, 2008 Jun 13, 2008
Hi everybody,

Is there a way to check which OS is running on the CF Server using CFML?

If yes, pls avise.

Thanks and regards,
Yogesh Mahadnac
TOPICS
Advanced techniques
593
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 13, 2008 Jun 13, 2008
<cfdump var="#server#">
or, specifically, #server.os.name#

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
LEGEND ,
Jun 13, 2008 Jun 13, 2008
<cfdump var="#server#">
or, specifically, #server.os.name#

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 13, 2008 Jun 13, 2008
even easier....

if you have a file on your server call foo.cfm - try accessing it using a different case, eg FOO.cfm - if it loads you're on windows, if it doesn't you're on a nix platform.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2008 Jun 13, 2008
and how is that gonna be 'easier' using cfml than #server.os.name#?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2008 Jun 13, 2008
LATEST
> and how is that gonna be 'easier' using cfml than #server.os.name#?

Yeah, that one had me scratching my head too.

If one was to be wanting to check via the file system, then checking
java.io.File's "separator" property would probably be the way to do it,
rather than checking file-name-casing, but the server variable route is the
easiest way.

__
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources