Re: Any chance of a BSD constant?
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 09, 2006
- 485 views
D. Newhall wrote: > I'm a huge FreeBSD fan (best server OS ever) but never really used Euphoria > on it for whatever reason until now. However, I've run into a problem with a > script I wrote. This script does some security related stuff and needs to open > a .so file. Sadly, on BSD I use a more reliable library than the one that > Linux > has but I need the script to work on both platforms but platform() returns > LINUX > for both. I had a workaround that used certain files in the filesystem > heirarchy > to determine the OS but I intend to use this on BSD as a jailed process and > don't want to have to allow access to certain directories just to determine > the platform. So, is there any chance of having a BSD constant for use by > platform() > for those of us that are developing for both BSD and Linux at a level where > they differ? I guess something should be done about this. Unfortunately the obvious solution of adding BSD to the list of platform constants won't work. I've already set the platform values to be the same for Linux and FreeBSD, since 90% of the time that's what you want. A lot of code would break if I gave BSD it's own platform value. I guess for now, if you can't detect a difference, using getenv(), or open() or something, you could just add your own BSD constant to your code, and change one line of code when you copy to a Linux machine. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com