File System Types in .Net

Posted by Avi on Stack Overflow See other posts from Stack Overflow or by Avi
Published on 2010-03-19T14:24:29Z Indexed on 2010/03/19 14:31 UTC
Read the original article Hit count: 182

Filed under:
|
|
|

I don't get the abstractions and the terminology :-(

For example, DirectoryInfo.FullName is defined as the full path of the directory or file, but it's a string! So is DirectoryInfo.Name, FileInfo.FullName, Path.GetDirectoyName and so on.

This means that in .Net there is no "depth" (or "meat" - my English isn't so good) for the file system objects. There's no protection from a type system. I can't, for example, define two Path objects and ask if one of them is "above" the other - I have to manipulate the strings. I can't differentiate between a Path that identifies a directory and a path that identifies a file. I can't do anything!-( Just manipulate strings.

Is this correct (or am I simply missing something). If correct, are there any alternatives?

© Stack Overflow or respective owner

Related posts about filesystems

Related posts about .NET