Removed osinfo_* modules.
They will be available under the 'osinfo' Nimble package.
This commit is contained in:
parent
c707923cc1
commit
d6c957e9b4
2 changed files with 18 additions and 486 deletions
|
|
@ -1,77 +1,10 @@
|
|||
import posix, strutils, os
|
||||
#
|
||||
#
|
||||
# Nim's Runtime Library
|
||||
# (c) Copyright 2015 Dominik Picheta
|
||||
#
|
||||
# See the file "copying.txt", included in this
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
when false:
|
||||
type
|
||||
Tstatfs {.importc: "struct statfs64",
|
||||
header: "<sys/statfs.h>", final, pure.} = object
|
||||
f_type: int
|
||||
f_bsize: int
|
||||
f_blocks: int
|
||||
f_bfree: int
|
||||
f_bavail: int
|
||||
f_files: int
|
||||
f_ffree: int
|
||||
f_fsid: int
|
||||
f_namelen: int
|
||||
|
||||
proc statfs(path: string, buf: var Tstatfs): int {.
|
||||
importc, header: "<sys/vfs.h>".}
|
||||
|
||||
|
||||
proc getSystemVersion*(): string =
|
||||
result = ""
|
||||
|
||||
var unix_info: TUtsname
|
||||
|
||||
if uname(unix_info) != 0:
|
||||
os.raiseOSError(osLastError())
|
||||
|
||||
if $unix_info.sysname == "Linux":
|
||||
# Linux
|
||||
result.add("Linux ")
|
||||
|
||||
result.add($unix_info.release & " ")
|
||||
result.add($unix_info.machine)
|
||||
elif $unix_info.sysname == "Darwin":
|
||||
# Darwin
|
||||
result.add("Mac OS X ")
|
||||
if "14" in $unix_info.release:
|
||||
result.add("v10.10 Yosemite")
|
||||
elif "13" in $unix_info.release:
|
||||
result.add("v10.9 Mavericks")
|
||||
elif "12" in $unix_info.release:
|
||||
result.add("v10.8 Mountian Lion")
|
||||
elif "11" in $unix_info.release:
|
||||
result.add("v10.7 Lion")
|
||||
elif "10" in $unix_info.release:
|
||||
result.add("v10.6 Snow Leopard")
|
||||
elif "9" in $unix_info.release:
|
||||
result.add("v10.5 Leopard")
|
||||
elif "8" in $unix_info.release:
|
||||
result.add("v10.4 Tiger")
|
||||
elif "7" in $unix_info.release:
|
||||
result.add("v10.3 Panther")
|
||||
elif "6" in $unix_info.release:
|
||||
result.add("v10.2 Jaguar")
|
||||
elif "1.4" in $unix_info.release:
|
||||
result.add("v10.1 Puma")
|
||||
elif "1.3" in $unix_info.release:
|
||||
result.add("v10.0 Cheetah")
|
||||
elif "0" in $unix_info.release:
|
||||
result.add("Server 1.0 Hera")
|
||||
else:
|
||||
result.add($unix_info.sysname & " " & $unix_info.release)
|
||||
|
||||
|
||||
when false:
|
||||
var unix_info: TUtsname
|
||||
echo(uname(unix_info))
|
||||
echo(unix_info.sysname)
|
||||
echo("8" in $unix_info.release)
|
||||
|
||||
echo(getSystemVersion())
|
||||
|
||||
var stfs: TStatfs
|
||||
echo(statfs("sysinfo_posix.nim", stfs))
|
||||
echo(stfs.f_files)
|
||||
|
||||
{.error: "This module has been moved to the 'osinfo' nimble package.".}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue