Main Site Documentation

Back to the root


#1

It may not be obvious (at least not to me). But the MF file tree is root based, just like old school unix. Unlike the familar drive based (i.e. c:, d:, etc) system in dos and windows, the root is king and exposed in MF. In fact, in NETMF, the colon character is an illegal path character. Just like in unix, you mount volumes as child items (appear as directories from root’s perspective) off the root:

\ - root
\SD - volume
\USB - volume
\xxx

In fact, nothing needs to be mounted and you can still list root (i.e. Directory.GetFiles(@ “”)). Not too useful, but can be interesting to further your understanding of IO tree.

Maybe obvious already or not too interesting to some, but realizing this turned on a light for me and was not really spelled out anywhere in MS docs I could find. Now makes me wonder if there some IProvider interface you can use to implement your own volume provider and yield items. If not, that could be useful.