# /proc/uptime 'n' friends



## weberjn (Jan 7, 2020)

Hi,

are there any plans to implement for FreeBSD /proc/uptime, /proc/loadavg, /proc/meminfo and the like?

In scripting languages and Java it is easier to read a file than to fork uptime and sysctl.



see: https://forums.freebsd.org/threads/how-can-i-know-the-boot-date-time-of-my-freebsd-system.72291/


----------



## shkhln (Jan 7, 2020)

No. You can always use JNA or jnr-ffi if forking is too expensive.


----------



## Nicola Mingotti (Jan 8, 2020)

weberjn said:


> In scripting languages and Java it is easier to read a file than to fork uptime and sysctl.



It all depends on your scripting language. In a Unix oriented scripting language e.g. In Ruby, Perl, various shell you just do ``uptime`` which is easier than reading a file IMO. 

If you want to stick to Java you can use JRuby.  It has all strengths and limits of Java. I used it seccessfully for a project.

```
$> jirb
irb(main):001:0> `uptime`
=> " 14:27:34 up 2 days,  3:23,  1 user,  load average: 0.23, 0.08, 0.06\n"
irb(main):002:0>
```

In Python it is a bit more verbose and It depends a lot on your Python release, see here: https://docs.python.org/3/library/subprocess.html

bye


----------

