Jump to content

[SOLVED] Operating system check


bobbfwed

Recommended Posts

This must have come up before, but the search function on these (and every other forum system) is impossible to get results out of...anyway...

 

I am trying to find the surest way to get the server's operating system. All I need is "Windows"/"Linux"/"Mac"/etc. I don't need versions or whatnot. I see some of that info entrenched in $_SERVER ... but I was wondering if there is a simpler way.

 

Also...while we are at it. I have a function that changes a file's or directory's permissions with chmod. But on windows the chmod of a directory seems to do very little. There are two settings: 0777 and 0555 (read-only). 0555 still allows you to rename the directory and create files/dirs inside of it. Files have only two options as well: 0666 and 0444 (read-only). Is there any way to beef it up?

So to relate to the server OS question: I will probably just do what windows does, only give you the read-only/everything options when on Windows, and give full octal control when on other operating systems (I'm assuming Mac -- at least MacX -- uses the Unix/Linux octal system?).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.