Compare commits

..

No commits in common. "f131b368e858d57f100699c0b7093aa64f536d9d" and "90b75ee0109ec3365679e12266a91cd7d1db29c5" have entirely different histories.

2 changed files with 2 additions and 8 deletions

View file

@ -1,7 +1 @@
https://stackoverflow.com/a/63373815
# test
```
PROCIO_DIR=test crystal procio.cr
```

View file

@ -1,9 +1,9 @@
dir = Path[ENV.fetch("PROCIO_DIR", "/proc")]
dir = ENV.fetch("PROCIO_DIR", "/proc")
result = {} of String => Array(UInt64)
time = Time.local.to_s("%s%9N")
Dir.entries(dir).each do |entry|
next unless (entry =~ /^\d+$/) && File.directory?(dir/entry)
entry =~ /^\d+$/ || next
begin
comm = File.read("#{dir}/#{entry}/comm").chomp