Closed eiriktsarpalis closed 9 years ago
In .Net File class is static and File.xxx methods return FileInfo so I think it is sensible for CloudFile to be static and for CloudFile.xxx methods to return CloudFileInfo.
Ambivalent re: GetInfo or FromPath - I'm used to FromPath but don't really mind either way. Perhaps FromPath is slightly clearer than GetInfo - the latter suggests that you're getting info on a CloudFileInfo.
Main thing is make sure it's consistent across File and Directory. @eiriktsarpalis and I also discussed some other related issues the other day e.g. what about the constructors for CloudFile - how do they fit into this?
And secondly - CloudFlow combinators that all say "FromCloudFile" now actually just take in strings which represent the path to the CloudFile. There's no longer any way to go directly from CloudFile to CloudFlow. 99% of the time this is what you want - and I believe that you can do a .Path on a CloudFile to get the string anyway - but the name is a little confusing. The overloads though that take in either a single or collection of paths is welcome, and preferable to the older way of having OfCloudFiles as well.
I just pushed commit b35c50345ecc11ae2ee30b8ec50ab1b66fa167d1 that effects the proposed changes. Please review so that we can address any API inconsistencies that may have cropped up.
Closing this for now
CloudFile
is a type that has been inherited from older versions of MBrace. Lately its function has mutated towards a cloud equivalent ofSystem.IO.FileInfo
, whereas most file store APIs simply accept path strings rather than CloudFile's. I think that the current naming might be a source of confusion, so I propose that CloudFile and CloudDirectory be renamed to CloudFileInfo and CloudDirectoryInfo respectively.Among other things, this would cause the confusingly named method
to be renamed to
Thoughts? /cc @isaacabraham @dsyme