Thoughts on std.system.OS

Vladimir Panteleev vladimir at thecybershadow.net
Sat Aug 13 03:38:00 PDT 2011


On Sat, 13 Aug 2011 13:23:08 +0300, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:

> That's certainly a thought, but that could get entertaining to get the  
> enum
> values from that. As long as the various distros are consistent in their
> naming schemes between their releases though, that _should_ be possible.  
> That
> may be worth trying though.

Not sure what you mean when you mention distros. Getting the distro  
name/version is a separate, much more complicated problem. AFAIK, there is  
no identifiable standard which distros adhere to to allow programmatic  
identification.

Hence, just the kernel version. The uname() system call returns it as a  
string. A possible complication is that the size of the structure that  
system call uses differs between UNIX flavors, and if I read the docs  
right, it even changed once or twice between Linux versions. (I thought  
Linux was maintaining binary compatibility between versions?)

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list