Praise due - base library filesystem methods

Praise due to the developers. I was looking for the equivalent to Python os.path in Julia, and it is of course all there
https://docs.julialang.org/en/latest/base/file/#Filesystem-1
Really clearly explained, and all very useful functions you would need.

I was thinking about how one would do operations such as
echo 0 > /sys/devices/system/cpu/cpu1/online
I guess backticks is fine, but is there a Julian way to manipulate the sysfs heirarchy? I guess this is bein g horribly Linux-centric.

Wouldn’t

open("/sys/devices/system/cpu/cpu1/online", "w") do io
    write(io, "0")
end

work?

Thankyou. That sounds suitably Julian.

You can also just do

write("/sys/devices/system/cpu/cpu1/online", "0")
4 Likes