Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » [SysInfo - Improvement - Koldo] Better way to find distribution version & more
Re: [SysInfo - Improvement - Koldo] Better way to find distribution version & more [message #40954 is a reply to message #40953] Sun, 13 October 2013 01:22 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1076
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Koldo,

Following two lines of code are tricky:
for (FindFile ff(AppendFileName("/etc/", "*-release")); ff; ff.Next())
	release += LoadFile_Safe(ff.GetPath());

This means, that find all files, that have "release" chain in their names. File "lsb-release" dosen't contain full version information, so we need to scan other files with "release" in their names.

************************************************************ ************************************************************ **

Here is the output (Ubuntu 13.04):
DISTRIB_VERSION=13.04
VERSION=13.04, Raring Ringtail

VERSION can be replaced with VERSION_ID (And even DISTRIB_VERSION to ID):
VERSION_ID=13.04
ID=ubuntu
************************************************************ ************************************************************ **

You can type following command in your terminal: "cat /etc/*-release":
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.04"
VERSION_ID="13.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"


Personally, I think we can add more information about distribution to SysInfo.
************************************************************ ************************************************************ **

P.S.
I uploaded old file (It doesn't compile!!!).
*I enclose newer version with lowercase fix.

Sincerely,
Klugier
  • Attachment: os.cpp
    (Size: 14.31KB, Downloaded 515 times)


U++ - one framework to rule them all.

[Updated on: Sun, 13 October 2013 13:06]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with FileBrowser
Next Topic: AES for sqlite database
Goto Forum:
  


Current Time: Mon May 13 07:19:58 CEST 2024

Total time taken to generate the page: 0.02427 seconds