Praise due - base library filesystem methods


#1

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.


#2

Wouldn’t

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

work?


#3

Thankyou. That sounds suitably Julian.


#4

You can also just do

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