This function which generates a Directory Tree
from a given path string
for e.g
if the String that is given is "home/what/dir" , "home/hello/foo"
then it will return a FileNode ( Struct )
which looks like this
head{
[{
[
{
[ { [] dir } ]
what
},
{
[ { [] foo } ]
hello
}
]
home
}]
"root"
}