1

Topic: System Question [SOLVED]

Hi, i'm trying to save a file in one place if it's Linux and another one if it's WIndows....
But if someone using Windows put to save on Linux, will show a error page.
How can i verify what of those are the user using?

Last edited by B. (2010-08-10 07:41:06)

Re: System Question [SOLVED]

B. wrote:

Hi, i'm trying to save a file in one place if it's Linux and another one if it's WIndows....
But if someone using Windows put to save on Linux, will show a error page.
How can i verify what of those are the user using?

I put "ruby detect operating system" into google, the first result told me that you can get the local OS with the RUBY_PLATFORM constant.

###########################################
#If i've helped you then please recommend me at Working With Rails:
#http://www.workingwithrails.com/person/ … i-williams

3

Re: System Question [SOLVED]

RUBY_PLATFORM =~ /mswin32/ works just perfect

Thank you.

My code is much simplier now. smile