prutya prutya - 2 months ago 7
Ruby Question

Is there a way to get File System root path in ruby?

I am making an education website which should display host file system.
Is there a way to get Operating System (or File System, I don't know exactly how it's called) root path?

Answer

If you are talking about the server File System, yes:

Dir.glob('/*').each do |name|
  puts name
end
Comments