I have some code running on Linux with Mono and I am trying to create paths which will then be passed to some file IO methods.
I'm finding that if I want to specify the root (eg: /etc/blah
instead of /MyApplication/etc/blah
) I have to do the following:
Directory.GetFiles(Path.Combine("/etc", "blah"))
However as you can see I have to manually specify that the first part is an absolute path with the /
. This defeats the purpose of the Path.Combine
. I looked at the documentation for an overload to specify if it should be a relative or absolute path but there isn't one.
How do I correctly specify an absolute path?