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

Check Windows or Linux?

Guest
Jun 13, 2008 Jun 13, 2008

Copy link to clipboard

Copied

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

Views

506

Translate

Translate

Report

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/

Votes

Translate

Translate
LEGEND ,
Jun 13, 2008 Jun 13, 2008

Copy link to clipboard

Copied

<cfdump var="#server#">
or, specifically, #server.os.name#

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

and how is that gonna be 'easier' using cfml than #server.os.name#?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Documentation