Compare commits
No commits in common. "f131b368e858d57f100699c0b7093aa64f536d9d" and "90b75ee0109ec3365679e12266a91cd7d1db29c5" have entirely different histories.
f131b368e8
...
90b75ee010
2 changed files with 2 additions and 8 deletions
|
@ -1,7 +1 @@
|
||||||
https://stackoverflow.com/a/63373815
|
https://stackoverflow.com/a/63373815
|
||||||
|
|
||||||
# test
|
|
||||||
|
|
||||||
```
|
|
||||||
PROCIO_DIR=test crystal procio.cr
|
|
||||||
```
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
dir = Path[ENV.fetch("PROCIO_DIR", "/proc")]
|
dir = ENV.fetch("PROCIO_DIR", "/proc")
|
||||||
result = {} of String => Array(UInt64)
|
result = {} of String => Array(UInt64)
|
||||||
time = Time.local.to_s("%s%9N")
|
time = Time.local.to_s("%s%9N")
|
||||||
|
|
||||||
Dir.entries(dir).each do |entry|
|
Dir.entries(dir).each do |entry|
|
||||||
next unless (entry =~ /^\d+$/) && File.directory?(dir/entry)
|
entry =~ /^\d+$/ || next
|
||||||
|
|
||||||
begin
|
begin
|
||||||
comm = File.read("#{dir}/#{entry}/comm").chomp
|
comm = File.read("#{dir}/#{entry}/comm").chomp
|
||||||
|
|
Loading…
Reference in a new issue